Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Expand all threads error

Quote Reply
Expand all threads error
Hello. I get an error when pressing the "expand all threads" or the [+] Button:

Code:


A fatal error has occurred:Can't call method "fetchrow_hashref" on an undefined value atGForum::Forum::view_expandable line 231. (that is for the [+] button, for the expand all threads button, it is in line 606)

Please enable debugging in setup for more details.

A fatal error has occurred:
Can't call method "fetchrow_hashref" on an undefined value at GForum::Forum::view_expandable line 231.


Please enable debugging in setup for more details.Stack Trace======================================GForum (20303324): GForum::Forum::view_expandable called at /u/web/ecamty/cgi-local/foro/admin/GForum.pm line 275 with arguments (GForum::Forum, forum_view_expandable, HASH(0x10396d5c)).GForum (20303324): GForum::_plg_do_func_2 called at /u/web/ecamty/cgi-local/foro/admin/GForum.pm line 239 with arguments (forum_view_expandable).GForum (20303324): GForum::__ANON__ called at /u/web/ecamty/cgi-local/foro/admin/GT/Plugins.pm line 108 with arguments (forum_view_expandable).GForum (20303324): GT::Plugins::dispatch called at /u/web/ecamty/cgi-local/foro/admin/GForum.pm line 239 with arguments (GT::Plugins, /u/web/ecamty/cgi-local/foro/admin/Plugins/GForum, do_forum_view_expandable, CODE(0x102dc854), forum_view_expandable).GForum (20303324): GForum::_plg_do_func called at /u/web/ecamty/cgi-local/foro/admin/GForum.pm line 230 with arguments (forum_view_expandable).GForum (20303324): GForum::__ANON__ called at /u/web/ecamty/cgi-local/foro/admin/GT/Plugins.pm line 108 with arguments (forum_view_expandable).GForum (20303324): GT::Plugins::dispatch called at /u/web/ecamty/cgi-local/foro/admin/GForum.pm line 230 with arguments (GT::Plugins, /u/web/ecamty/cgi-local/foro/admin/Plugins/GForum, do_func, CODE(0x102da5d4), forum_view_expandable).GForum (20303324): GForum::do_func called at /u/web/ecamty/cgi-local/foro/gforum.cgi line 106 with arguments (forum_view_expandable).GForum (20303324): main::main called at /u/web/ecamty/cgi-local/foro/admin/GT/Plugins.pm line 108 with no arguments.GForum (20303324): GT::Plugins::dispatch called at /u/web/ecamty/cgi-local/foro/gforum.cgi line 22 with arguments (GT::Plugins, /u/web/ecamty/cgi-local/foro/admin/Plugins/GForum, main, CODE(0x10256660)).System Information======================================Perl Version: v5.6.0Gossamer Forum Version: 1.1.8GForum.pm version: 1.118GT::SQL Version: 1.099GT::Template Version: 2.084DBI.pm Version: 1.14@INC = /path to cgis/foro/admin /usr/local/lib/perl56/5.6.0/irix-n32-mips3 /usr/local/lib/perl56/5.6.0 /usr/local/lib/perl56/site_perl/5.6.0/irix-n32-mips3 /usr/local/lib/perl56/site_perl/5.6.0 /usr/local/lib/perl56/site_perl .GT::SQL::error = Failed to execute query: ' SELECT * FROM gforum_Post /*!32312 USE INDEX (p_rfl) */ LEFT OUTER JOIN gforum_User ON gforum_Post.user_id_fk = gforum_User.user_id WHERE (gforum_Post.forum_id_fk = '3' AND gforum_Post.post_root_id = '0') ORDER BY post_latest_reply ASC LIMIT 0, 25 ' Reason: You have an error in your SQL syntax near '32312 USE INDEX (p_rfl) */ LEFT OUTER JOIN gforum_User ON gforum_Post.user_id_fk' at line 3

Last edited by:

ecamty: Sep 15, 2002, 11:50 PM
Quote Reply
Re: [ecamty] Expand all threads error In reply to
I think I had the same problem at some point. Jason suggested to run the following query, and the problem was fixed:
Code:
ALTER TABLE gforum_Post ADD INDEX p_rfl (post_root_id, forum_id_fk, post_latest_reply)
Maybe this also helps for you.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Expand all threads error In reply to
I get the following message when running that query:

ERROR 1061 at line 1: Duplicate key name 'p_rfl'



Should I be getting that message? And can I do something else?
Quote Reply
Re: [ecamty] Expand all threads error In reply to
OK, then you don't have the same problem as I had.

As a temporary fix, you could also try commenting out one line in GForum/Forum.pm (around line 60):
Code:
# local $PostUser->{tables_ord}->[0] = "$PostUser->{tables_ord}->[0] /*!32312 USE INDEX (p_rfl) */"; # MySQL hack to use the intended index
I.e. add the #.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Expand all threads error In reply to
Done that already, it solves a problem causing an error when opening forums (say "Home:Products")

I get the following table when i check the gforum_Post table in MySQL:

Database: ecamty Table: gforum_Post Rows: 3
+-------------------------+---------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------------------+---------------------+------+-----+---------+----------------+
| post_id | int(10) unsigned| | PRI | 0 | auto_increment |
| user_id_fk | int(10) unsigned| | MUL | 0 | |
| post_unique_id | varchar(32) | | MUL | 0 | |
| post_username | varchar(50) | | MUL | | |
| post_signature_deleted | text | YES | | | |
| forum_id_fk | int(10) unsigned| | MUL | 0 | |
| post_root_id | int(10) unsigned| | MUL | 0 | |
| post_father_id | int(10) unsigned| | MUL | 0 | |
| post_depth | int(10) unsigned | | | 0 | |
| post_time | int(11) | | MUL | 0 | |
| post_latest_reply | int(11) | | | 0 | |
| post_latest_poster | varchar(50) | | | | |
| post_subject | varchar(255) | | | | |
| post_message | mediumtext | | | | |
| post_style | tinyint(3) unsigned | | | 0 | |
| post_ip | varchar(15) | | | | |
| post_last_edit_username | varchar(50) | YES | | | |
| post_last_edit_time | int(11) | YES | | | |
| post_anonymous_email | varchar(75) | YES | | | |
| post_thread_hot | tinyint(3) unsigned | YES | | | |
| post_locked | tinyint(3) unsigned | YES | | | |
| post_keep | tinyint(3) unsigned | | | 0 | |
| post_reply_notify | tinyint(3) unsigned | YES | | | |
| post_has_attachments | tinyint(3) unsigned | | | 0 | |
| post_replies | int(10) unsigned | | | 0 | |
| post_deleted | tinyint(3) unsigned | | | 0 | |
| post_deleted_by | varchar(50) | YES | | | |
| post_deleted_time | int(11) | YES | | | |
| post_icon | varchar(255) | YES | | | |
| post_moved | tinyint(3) unsigned | YES | | | |
| post_moved_id | int(10) unsigned | YES | | | |
+-------------------------+---------------------+------+-----+---------+----------------+

Sorry if it isnt aligned correctly, I have attached a gif with the table so it is more legible. Is this the way it should look?

Last edited by:

ecamty: Sep 16, 2002, 1:00 AM
Quote Reply
Re: [ecamty] Expand all threads error In reply to
Looks good to me.

I guess you have to wait for a solution until Jason gets up.....

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Expand all threads error In reply to
Ok, thanks!

I think I have just found out the problem tho... I changed the "Expand all threads" buttons to spanish, making them "Expander todas las discusiones". I think somehow thats what messed it up. Im gonna change those buttons back to english and see if that works.
Quote Reply
Re: [ecamty] Expand all threads error In reply to
Nope, that didnt fix the problem.
Quote Reply
Re: [ecamty] Expand all threads error In reply to
The URL of my forum is:

http://www.ecamty.net/...ocal/foro/gforum.cgi

To see the actual error message, open one of the forums that contain something and press "Expander todas las discusiones". (Which is equivalent to "expand all threads") Or by clicking on the "+" image.

Thanks a lot!

Ecamty

BTW, I installed with the ?lite=1 option, so it may be the reason for some problems.

Last edited by:

ecamty: Sep 16, 2002, 2:19 AM
Quote Reply
Re: [ecamty] Expand all threads error In reply to
I just noticed that there are several occurrences of the line
Code:
local $PostUser->{tables_ord}->[0] = "$PostUser->{tables_ord}->[0] /*!32312 USE INDEX (p_rfl) */"; # MySQL hack to use the intended index
Can you try to comment them all? Maybe this helps

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [ecamty] Expand all threads error In reply to
Can you find out which version of MySQL you are using?

SELECT VERSION();

in the SQL Monitor will give it to you.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Jagerman] Expand all threads error In reply to
Its version 3.22.23b-log

Should I comment out the lines yogi mentioned?
Quote Reply
Re: [ecamty] Expand all threads error In reply to
Yes - it appears that the feature MySQL added to support version-specific features (such as the USE INDEX line) wasn't supported in your version Unsure. I'd recommend upgrading, if possible, as it will result in better performance. If that isn't possible, commenting out those lines will fix the error. There are 3 lines in admin/GForum/Forum.pm, and one in admin/GForum/Category.pm (just search for USE INDEX, in capital letters).

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Jagerman] Expand all threads error In reply to
Should the Forum.pm look like this?

Code:
#local $PostUser->{tables_ord}->[0] = "$PostUser->{tables_ord}->[0] /*!32312 USE INDEX (p_rfl) */"; # MySQL hack to use the intended index
Quote Reply
Re: [ecamty] Expand all threads error In reply to
Yeah, just comment out all four lines (3 in Forum.pm, 1 in Category.pm) like that.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Jagerman] Expand all threads error In reply to
Thanks, its working now.