Getting this error on the "Add Vocabulary" page (admin/structure/taxonomy/add):

Notice: Undefined property: stdClass::$vid in tvi_vocab_form() (line 14 of /--/--/--/sites/all/modules/tvi/includes/tvi.admin.inc).

I'm able to create/save a new vocabulary, but after saving, I see the following errors:

    Notice: Undefined property: stdClass::$vid in tvi_vocab_form() (line 14 of /--/--/--/sites/all/modules/tvi/includes/tvi.admin.inc).
    Notice: Undefined offset: 1 in tvi_validate_handler() (line 187 of /--/--/--/sites/all/modules/tvi/includes/tvi.admin.inc).

Also, whenever I add a new term to the new or existing vocabularies, the 'Use view override' checkbox is always checked by default (whether or not the vocabulary also has 'Use view override' checked). Not sure if that's related, but it seemed to occur around the same time. Will post separate issue if not related.

Any help would be greatly appreciated! Thanks!

Comments

joelrotelli’s picture

Status: Active » Needs review
StatusFileSize
new475 bytes

Here's a patch for the dev. version, performing the test to control the existence of the 'vid' property

areikiera’s picture

Thanks so much! That appears to have fixed the problem when creating the Vocabulary, however now when I click the Delete button to delete the Vocabulary, on the 'Are you sure...' page I get this error:

Notice: Undefined offset: 1 in tvi_validate_handler() (line 187 of /--/--/--/sites/all/modules/tvi/includes/tvi.admin.inc).

Same as the second error I originally saw right after saving. Is this related?

joelrotelli’s picture

StatusFileSize
new1.06 KB

It's not related but with this patch fix this error

It seems that some controles are missing in this module

ps: those patches are part of the #1day1patch initiative :)

duaelfr’s picture

Status: Needs review » Fixed
StatusFileSize
new2.09 KB

I just pushed this to the dev branch.

The first patch was rewriten to not only workaround the issue but fix it.
The second was commited and authored to joel (with just a little rewrite for the coding standards).

Here is the final patch (#1day1patch) if someone find it useful.

areikiera’s picture

Thanks so much! Working like a charm!

areikiera’s picture

Status: Fixed » Active

Oops, spoke too soon. Just ran into this viewing the individual term pages:

    Notice: Undefined property: stdClass::$status in tvi_get_term_info() (line 294 of /--/--/--/sites/all/modules/tvi/tvi.module).
    Notice: Undefined property: stdClass::$status in tvi_get_term_info() (line 306 of /--/--/--/sites/all/modules/tvi/tvi.module).

Is this related? If not, I'll start a new issue.

Thanks!

**EDIT** In my case, the vocabulary was using the view override, but the term itself was not. I got the error to go away by checking the view override option on the term and saving. Then I edited it again, unchecked use view override, and it was still gone. / I'm thinking this isn't a problem with the patch itself or even the latest dev version, but that I'd created these terms before switching to the new dev version. Does there need to be a way to set the status on terms that didn't previously have one set?

duaelfr’s picture

Version: 7.x-1.0-beta1 » 7.x-1.x-dev
Status: Active » Closed (fixed)

Please open a new issue, I do not think it is related.
Moreover, you may not have the last dev version as there is no occurence of status at the line 294 on my version.

mwbyrd’s picture

I think the key is to set up the TVI module before creating your adding terms to your vocabulary. If I edit each term to use the TVI override, the errors disappear for those terms.

I haven't finished updating my terms (bike brands) so you can see. I updated the Cervelo Brand and it no longer throws the error.

You can see what I mean at http://www.bikeshopscharlottenc.com.