Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Re: [joet] Modification of non-creatable array value attempted, subscript -1

Quote Reply
Re: [joet] Modification of non-creatable array value attempted, subscript -1 In reply to
This was a 1.1.8 bug, fixed in 1.2.0. The bug created a thread which thinks it has more replies than it really does, which breaks things later on when trying to call up the thread. It comes about when deleting partial threads. To fix it up for your installation without upgrading to 1.2.0, you need to take two steps:

1) Fix the bug so that it doesn't happen again. You need to open up GForum/Table/Post.pm (not GForum/Post.pm) and look for:
Code:
# Update the ancestors
$self->update({ post_replies => \'post_replies - 1' } => { post_id => \@ancestors });

The second line needs to change to become:
Code:
# Update the ancestors
$self->update({ post_replies => \('post_replies - ' . @children) } => { post_id => \@ancestors });

(I've highlighted the changed section in red for you).

2) Then, to actually fix your current database, you need to run the 'repair_post_table.pl' script in the gforum/admin/tools directory.

Alternatively, you can perform a 1.2.0 upgrade. As long as your templates have been edited through the template editor in the admin panel, and you haven't directly edited GForum code (unlikely) such an upgrade should be perfectly safe, and the 1.2.0 upgrade contains code to correct the problem.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Subject Author Views Date
Thread Modification of non-creatable array value attempted, subscript -1 joet 3482 Jan 12, 2004, 7:58 AM
Thread Re: [joet] Modification of non-creatable array value attempted, subscript -1
Jagerman 3394 Jan 12, 2004, 1:21 PM
Thread Re: [Jagerman] Modification of non-creatable array value attempted, subscript -1
joet 3398 Jan 12, 2004, 1:43 PM
Thread Re: [joet] Modification of non-creatable array value attempted, subscript -1
Jagerman 3402 Jan 12, 2004, 1:49 PM
Post Re: [Jagerman] Modification of non-creatable array value attempted, subscript -1
joet 3399 Jan 12, 2004, 2:12 PM