0.9 beta1 - entries with userid=0

Found a bug? Tell us!!
Post Reply
cruiser

0.9 beta1 - entries with userid=0

Post by cruiser »

I run a 0.9 beta1 with two authors.

If authorid=2 writes an entry, this entry will get uderid=0 in the entries table.
:( as a result, nobody can comment this entry.

Help!

Cheers,
Martin
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: 0.9 beta1 - entries with userid=0

Post by garvinhicking »

Hi!

Could you please edit your include/functions_entries.inc.php file and locate the serendipity_updertEntry() function. Locate this code:

Code: Select all

    if (!is_numeric($entry['id'])) {
        /* we need to insert */

        unset($entry['id']);
        $entry['comments'] = 0;

        // New entries need an author
        $entry['author']   = $serendipity['user'];
        if (!isset($entry['authorid']) || empty($entry['authorid'])) {
            $entry['authorid'] = $serendipity['authorid'];
        }

please modify this to:

Code: Select all

    if (!is_numeric($entry['id'])) {
        /* we need to insert */

        unset($entry['id']);
        $entry['comments'] = 0;

        // New entries need an author
        $entry['author']   = $serendipity['user'];
        if (!isset($entry['authorid']) || empty($entry['authorid'])) {
            $entry['authorid'] = $serendipity['authorid'];
        }
        echo "Entry author: {$entry['author']}<br />\n";
        echo "Entry author ID: {$entry['authorid']}<br />\n";
        echo "Serendipity debug: " . print_r($serendipity, true) . "<br />\n";
        echo "Session debug: " . print_r($_SESSION, true) . "<br />\n";
Then I would need the HTML output when you save an entry. Replace all sensitive information like passwords with "***" please.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply