Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Modification of non-creatable array value attempted, subscript -1

Quote Reply
Modification of non-creatable array value attempted, subscript -1
I'm getting the following error report in one of my forums, I've tried looking the archives, but they don't seem to have any resolution to this problem.

Could anyone provide any insight into this problem?

Thanks

Code:
A fatal error has occurred:

Modification of non-creatable array value attempted, subscript -1 at /www/forums.christianity.com/htdocs/admin/GT/SQL/Tree.pm line 610.

Please enable debugging in setup for more details.
--
Christianity.com Forums
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
Quote Reply
Re: [Jagerman] Modification of non-creatable array value attempted, subscript -1 In reply to
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:
Thanks. I've applied the fix, and from what I can tell, all seems to be working properly.

In Reply To:
Then, to actually fix your current database, you need to run the 'repair_post_table.pl' script in the gforum/admin/tools directory.
I dont think repair_post_table.pl is included in the 1.1.8 distribution.... is there somewhere I can download this script from?


In Reply To:
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.

I have looked into upgrading to 1.2.0, which would be ideal... however, we have several custom inhouse plugins, as well as custom templates, and we just havn't had time to do compatibility testing before we deploy 1.2.0 to the production servers.


Thanks for your help.
--
Christianity.com Forums
Quote Reply
Re: [joet] Modification of non-creatable array value attempted, subscript -1 In reply to
In Reply To:
In Reply To:
Then, to actually fix your current database, you need to run the 'repair_post_table.pl' script in the gforum/admin/tools directory.
I dont think repair_post_table.pl is included in the 1.1.8 distribution.... is there somewhere I can download this script from?

Oops, my mistake, this initially came with 1.2.0 as well. I've attached the script.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Jagerman] Modification of non-creatable array value attempted, subscript -1 In reply to
In Reply To:
In Reply To:
In Reply To:
Then, to actually fix your current database, you need to run the 'repair_post_table.pl' script in the gforum/admin/tools directory.
I dont think repair_post_table.pl is included in the 1.1.8 distribution.... is there somewhere I can download this script from?

Oops, my mistake, this initially came with 1.2.0 as well. I've attached the script.

Thanks. I'll have the script run overnight, since it looks like a pretty big operation...
--
Christianity.com Forums