I installed the lastest Dev version and ran Update. I get the following error.

The following updates returned messages
tvi module
Update #7001

    Failed: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'xid' cannot be null: UPDATE {tvi_settings} SET xid=:db_update_placeholder_0 WHERE (type = :db_condition_placeholder_0) AND (xid = :db_condition_placeholder_1) ; Array ( [:db_update_placeholder_0] => [:db_condition_placeholder_0] => vocab [:db_condition_placeholder_1] => 24 ) in tvi_update_7001() (line 64 of /home/***/public_html/sites/all/modules/tvi/tvi.install).
CommentFileSizeAuthor
#7 tables.zip2.7 KBwimberb

Comments

duaelfr’s picture

Status: Active » Postponed (maintainer needs more info)

It is a really strange bug because when I read the official API for the "hook_install" function that is what I see :

The module's schema version will be set to the module's greatest numbered update hook. Because of this, any time a hook_update_N() is added to the module, this function needs to be updated to reflect the current version of the database schema.

So after installing the module, its schema version may be automatically set to 7003 and then, launching the update may not run any function.

I will try to reproduce this ASAP.
Can somebody else confirm this bug please ?

wimberb’s picture

The first time I ran Update there were 7001, 7002, and 7003 updates listed. But I received the above mentioned error. Subsequent attempts to run Update return the following updates needed and the error persists.

tvi module

    7001 - Replace vids by machine_names and tids by uuids if enabled.
    7002 - Drop schema in favor of {variable} table.
duaelfr’s picture

I just don't understand why Drupal ask you to run these updates.

Theorically, when you first install the module it will look for the last update number et never ask to do it and previous ones.
Could you try to uninstall (not just disable) the module then reinstall it completely please ?

wimberb’s picture

Hmmm... I could do that but then wouldn't that wipe out all of the Taxonomy views I have defined? It would be quite involved to go back through the entire site and track down all the broken tvi links and redefine them. I don't even know how I would track them all down now.

duaelfr’s picture

Priority: Normal » Major
Status: Postponed (maintainer needs more info) » Needs work

You are right !
I just get your problem sorry...

DO NOT UNINSTALL :)

I will provide a patch within 24 hours.

duaelfr’s picture

Status: Needs work » Postponed (maintainer needs more info)

This bug is really strange because the only case it could happen would be to have a vocabulary having no machine name...
Could you attach me a dump of your tvi_settings and taxonomy_vocabulary database tables ?

wimberb’s picture

StatusFileSize
new2.7 KB

Here you go. I'm heading out of town this afternoon so if there is anything else you need ask soon.

duaelfr’s picture

Status: Postponed (maintainer needs more info) » Needs work

I found it !
This error is due to old settings from deleted vocabularies...

I start to work on it right now.

duaelfr’s picture

Status: Needs work » Closed (fixed)

I just pushed a fix on the 7.x branch.
Feel free to reopen if needed.