I had several Vocabulary Index blocks and pages configured, but somehow the configuration got lost; don't know how, but I have seen this happening a couple of times already. If I now go to blocks/pages administration I get the following error message:
You haven't yet got any vocabularies to enable an index for; you may create them at the categories page.

and yet a dozen vocabularies are definitely still there... If there is something I should look into please let me know before I reinstall from scratch. Thank you.

Comments

xano’s picture

Assigned: Unassigned » xano

Vocabulary Index keeps track of all existing vocabularies in its own table. If this gets messed up, the solution is to reinstall Vocabulary Index, so it can 'rebuild' the vocabulary data.

If you keep experiencing data loss, please provide step by step instructions on how to reproduce this problem using the latest development version and a clean Drupal installation.

dries arnolds’s picture

I had the same issue in 6.x-2.0-rc2. After I deleted one vocabulary and severely edited another (which had a vocab index page) that index page didn't exist anymore, nor could I build a new page on the same vocab.

xano’s picture

Status: Active » Postponed (maintainer needs more info)

Please provide step by step instructions on how to reproduce the problem using a clean Drupal installation and the latest development version of Vocabulary Index or I won't be able to fix the problem.

skizzo’s picture

Yesterday, for no apparent reason, I stepped into this bug twice again: the problem is elusive and I could not find a way reproduce it. Nothing shows up in httpd error log, while Drupal watchdog lists the following error, maybe it is just a consequence of the problem... Does the extra slash say anything? Maybe the code can be instrumented with a sanity check, for debugging purposes?Attempt to assign property of non-object/ in //var/[...]/vocabindex.view.inc/ on line /241/.

skizzo’s picture

It just happened. I was not doing anything specific with vocabindex configuration. I just entered a panel page, the panel does include 3 vocabindex' blocks (now reading "There are currently no terms in this vocabulary"). If I now check the vocabindex table with myPhpAdmin, the table turns out to be empty. Three messages in log read "Attempt to assign property of non-object in /var/www/drupal/sites/all/modules/vocabindex/vocabindex.view.inc on line 241."

xano’s picture

I know there are some bugs when used with Panels (only when using multiple alphabetical views on a single page and I'm going to fix this ASAP), but none that should empty the table :S

Could you try to test some more and see if you can find a situation in which this problem always occurs?

skizzo’s picture

I can't identify a pattern... It happened again now, with a different twist: I see the error
warning: Attempt to assign property of non-object in [...]/vocabindex.view.inc on line 241.
(and the "There are currently no terms in this vocabulary" message) for one vocabulary only
out of 15. However this time the vocabindex table IS stilll there, and contains all the required data.
(indeed after a couple of reloads the block showed up again...)

@Pixelstyle: are you using the "Taxonomy redirect" module?

xano’s picture

The message There are currently no terms in this vocabulary means that Vocabulary Index succesfully displays a VI, but that there are no terms for the vocabulary to display. If there are terms, then this is most likely a problem with Taxonomy, since vocabindex used taxonomy_get_tree() to get all terms for a vocabulary.

skizzo’s picture

yes, it was an empty vocabulary indeed. That leaves me back to the original problem. Really weird... the vocabindex table loosing all its data. Is there a way in mySQL to make the table "read-only", so that any violation attempt would be reported?

xano’s picture

No, since the table needs to be updated if vocabularies are added or deleted or if VIs are updated. Haven't gotten the time to look into this problem yet.

skizzo’s picture

I thought that it could have something to do with Taxonomy Redirect, but that proved false: I disabled Taxonomy Redirect but later on the problem showed up again in Vocab Index (blocks only). I am using Panels and Domain Access, but cannot disable those really, as they are central to my architecture. Setting up a similar environment would be quite time consuming... so I don't know if you can reproduce the problem. Hopefully Pixelstyle or someone else can qualify it in a more restricted context. Thank you for putting your effort on this nice module, If I won't be able to use it... I will be really missing it!

xano’s picture

Priority: Normal » Critical

The problem was that hook_taxonomy() passed on old parameters to vocabindex_vi_delete(), which would delete all VI data if only a single vocabulary were deleted.

Fixed and committed to all branches.

xano’s picture

Status: Postponed (maintainer needs more info) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

xano’s picture

Assigned: xano » Unassigned