I am getting the following error when I just try to enable the module. I have run into this same exact problem on both Drupal 6 and 5.5. Here is the error I am receiving:

Parse error: parse error, unexpected T_OBJECT_OPERATOR in /homepages/31/d216745889/htdocs/UA_Union/Drupal6/modules/vocabindex/vocabindex.module on line 174

After I enable it, I am unable to go to any other page, and have to delete the vocabindex folder from the modules directory so that I can at least use Drupal again.

Any Help would be greatly appreciated,
Thanks

Comments

xano’s picture

Assigned: snowdude46 » xano
Category: support » bug
Priority: Normal » Critical

Changed the tags to better match the seriousness of the issue. I'll attend to this tomorrow.

//By the way: what kind of PHP version are you using?

snowdude46’s picture

I am using php 5.2.4

snowdude46’s picture

Version: 5.x-1.x-dev » 6.x-1.x-dev
StatusFileSize
new2 KB

I was able to get the module working by changing the following code on line 174

Previous Code:
$vid=db_fetch_object($vid_result)->vid;

New Code:
$vid_temp = db_fetch_object($vid_result);
$vid=$vid_temp->vid;

So far it seems to be working... I have only tested this on Drupal6 just to let you know.

I'll also attach the vocabindex.module file to this comment.

Note: This only works for Drupal 6 using vocabindex dev6.x-1.x

brewreview.info’s picture

Version: 6.x-1.x-dev » 5.x-1.x-dev

Can't vouch for drupal 6.x, but this is still a problem with drupal 5.5.

I was getting the same WSOD "Parse error:" that Surprise was seeing. Replaced the stock vocabindex.module with the zipped modifed file posted mere hours ago, and now I'm able to get back into my site.

BUT....

I'm also seeing the following ugly-looking error:

user warning: Table 'brewrevi_drpl1.vocabindex' doesn't exist query: SELECT vi.path, v.name FROM vocabindex vi LEFT JOIN vocabulary v ON vi.vid=v.vid in /home/brewrevi/public_html/beer/includes/database.mysql.inc on line 172.

I'm not nearly enough comfortable with hacking into my MySQL database to perhaps fix this. So, that having been said, I'll have to disable usiing this module for the short-term. Would like to see it happen though. Subscribing.

Cheers,
//TB

snowdude46’s picture

Its because that file was for vocabindex 6.x-1.x-dev. I will see if i can get a working one for 5.x

snowdude46’s picture

Well i found out the problem in the 5.x version. The problem is that if you declared a prefix for all your drupal tables when you first installed drupal it will not work with this because it doesn't take the table prefixes into account. I manually added them into all the table names in the vocabindex.module file and it seems to be working. I am not exactly sure how to make this automated but I will continue to look into it.

snowdude46’s picture

StatusFileSize
new8.08 KB

Well I fixed the Vocabindex 5.x version so it at least works...for me at least. Here is the fixed version.

You might have to Uninstall the module and reinstall it because of how I changed the created table to use the standard prefix, which the existing table does not have it, and will probably raise an error.

Note: this is only for Drupal 5.

brewreview.info’s picture

Version: 6.x-1.x-dev » 5.x-1.x-dev

Thanks for the quick response! :)

The modified module fixed the various errors I was seeing, but I'm very sorry to say that this is still not all that useful for my needs.

For example, here's the vocabindex page for my Vocabulary called "Country" (that also includes the various states and provinces):

http://www.brewreview.info/beer/country-list

Note how the records are in reverse order (alphabetically), and that all of the states and provinces are on the bottom of the list, not tied to their parents (all of the US states not clearly tied to their "United States" Parent, all of the Belgian provinces not cleared tied to their "Belgium" Parent but are instead at the very very bottom, etc...)

Cheers,
//TB

snowdude46’s picture

Yeah i see what you are saying...This would be nice for my purposes of having multi tiered download categories too. Let me see what i can come up with for making it display parent/child nodes in a tree like fashion. Give me a couple days and hopefully I can come up with something.

xano’s picture

Okay, I'm back online. My Mac broke down after trying to install Windows on it next to OS X. That's why I haven't responded.

I'll try to attend the issues ASAP. Due to the crash I have lost most recent stuff, so I'll have to code all upgrades for the 1.0 version (that wasn't online yet) again from scratch. Many thanks for the input, Surprise. I'll take a look at your code as soon as I can.

snowdude46’s picture

Ouch! That sure does suck about the upgrades getting lost from the crash! But Im glad you got it working :-). Yeah my code is a real hack job, but at least it somewhat worked.

xano’s picture

Status: Active » Postponed (maintainer needs more info)

I have changed line 174 according to what Surprise has posted on it. I haven't gotten the error myself, neither with a running install, nor with a clean Drupal install. Nevertheless the code Surprise suggested was a little cleaner than mine, so I used it.

I have changed the status of this issue. Please provide me with some more information about the problem. Otherwise I'm unfortunately not able to help you guys out.

snowdude46’s picture

I am sorry about how i was using php 5.2.4. It was php 4.7 i think...i am not exactly sure now the exact version but i know it was at least php 4. I am using php 5.2.4 now and everything is working great.

xano’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)
Issue tags: +Newbie

Never mind, we're all human ;-)

xano’s picture

Assigned: xano » Unassigned