Smartqueue taxonomy should save field names in its configurations. Relying on field_id is not a solid solution.

This is also needed for #373174: Export and import capability for nodequeue to work properly.

Patch is provided.

Comments

amateescu’s picture

Status: Needs review » Needs work

The patch looks very good, but I think we need an update function to converting existing queues..

paranojik’s picture

Added the update function.

paranojik’s picture

Status: Needs work » Needs review

Anyone care to review?

amateescu’s picture

Status: Needs review » Fixed

Tested the patch and it works great.

Commited to 7.x-2.x. Thanks!

http://drupalcode.org/project/nodequeue.git/commit/a4ea38b

Status: Fixed » Closed (fixed)

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

killes@www.drop.org’s picture

Issue summary: View changes
Status: Closed (fixed) » Needs work

Reopenening this, I think the update function is flawed. It seems to assume that a field always has the same ID as the taxonomy vocabulary. This is certainly not correct! In my case smartqueues ended up attached to the wrong vocab.

SebCorbin’s picture

This problem happens when upgrading from Drupal 6, when smartqueues were handled via vocabulary ID, we need to add a hook_update_7000() that gather (or create) corresponding taxonomy reference fields and replace vids by field_ids.

Then the conversion from field_id to field_name will be handled by smartqueue_update_7001()

killes@www.drop.org’s picture

StatusFileSize
new1.67 KB

I uploaded a new patch that fixes the issue for me.

Unfortunately, I see no way to fix the issue for people who already made the upgrade.

Also, it may be required to implement some hook in case the field name changes, if it is not there already.

killes@www.drop.org’s picture

Status: Needs work » Needs review

and changing the status.

killes@www.drop.org’s picture

StatusFileSize
new2.03 KB

wasn't quite right, needed hook_update_dependencies

killes@www.drop.org’s picture

Status: Needs review » Needs work

It works when I run the update stand-alone, but not in a complete update. Strange.

SebCorbin’s picture

As said in #7, this issue now concerns only the upgrade path from D6 to D7, so you should write the update hook as hook_update_7000().

It is generally a bad practice to modify already written update hooks :)

killes@www.drop.org’s picture

Well, I didn't mess up the initial hook. If you have an idea on how to help people that already did the upgrade, let me know. I have none, since the neccessary information was deleted during the faulty upgrade.

Also, it's just a beta release...

fizk’s picture

Status: Needs work » Closed (won't fix)