Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi!
Using this module versions:
- Nodequeue 7.x-3.x-dev
- Features_extra 7.x-1.x-dev
We had this error during the export of a feature containing a nodequeue:
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'qid' in 'field list': SELECT qid, name FROM {nodequeue_queue}; Array ( ) in _fe_nodequeue_get_qid_map() (linea 227 di (...)/sites/all/modules/contrib/features_extra/fe_nodequeue.module).
(You can see the screenshot attached)
Searching in fe_nodequeue.module code, we found that the problem is that, at line 227 we had:
$result = db_query("SELECT qid, name FROM {nodequeue_queue}");
In the 7.x-3.x version of Nodequeue, the column qid on nodequeue_queue table does not exist.
Comment | File | Size | Author |
---|---|---|---|
#10 | features_extra-fix_fe_nodequeue_export-2050119.patch | 1.78 KB | bmeme |
#5 | features_extra-fix_fe_nodequeue_export-2050119.patch | 1.26 KB | bmeme |
#1 | features_extra-fix_fe_nodequeue_export-2050119.patch | 1.1 KB | bmeme |
Screen Shot 2013-07-25 at 12.44.44 PM.png | 55.57 KB | bmeme |
Comments
Comment #1
bmeme CreditAttribution: bmeme commentedHere is the patch!
Comment #2
pfrenssenSee also #1845752: Make fe_nodequeue work with nodequeue-7.x-3.x-dev.
Comment #4
pfrenssenThe test fails because this patch is not backwards compatible with Nodequeue 7.x-2.x:
Comment #5
bmeme CreditAttribution: bmeme commentedAttached you'll find a new version of the patch. The $query->innerJoin now is done on title and not on name. I tested it on Nodequeue 3.x and Nodequeue 2.x and it worked.
IMHO is not a very good solution, but I think it could be the best we have if we want to have backward compatibility with Nodequeue 7.x-2.x and (at the same time) we do not want to change the approach of fe_nodequeue module.
On the other hand, in the new version of Nodequeue 7.x-3.x, the db schema was changed... I think that, in any case, features_extra should bring out a new module version compliant only with the new version of Nodequeue, ensuring maintenance on the old version related to 2.x version of Nodequeue. I know that this could mean doubling the work but i think that changing the approach of fe_nodequeue could mean trashing some working code to work on a new code to develop test and fix.
My two cents...
Comment #6
pfrenssenComment #8
pfrenssenThere's no need to create a new version of Features Extra since we can detect which version of Nodequeue is in use with system_get_info('module', 'nodequeue'). The best solution would be to write a base class to interface with Nodequeue, and extend it with a 2.x and a 3.x version.
Comment #9
pfrenssenComment #10
bmeme CreditAttribution: bmeme commentedSorry for the previous patch. I did it from a wrong position and then the test obviously is failed. I wrote a new patch for this module. I am also convinced that the solution proposed by pfrenssen is the best...but in this moment I haven't time to contribute in this way. Meanwhile I added a function that checks about nodequeue module version and, in case of "3", applies my original patch. I tried it with nodequeue 2.x and nodequeue 3.x and it seems to work.
I think that this is not the best solution we can have, but could be a "quick and (not-so) dirty" way to make this module working also on 3.x version of Nodequeue.
Bye.
Comment #11
pfrenssenSure, I understand completely. I also have little spare time at the moment. Maybe you or I will find the time in the future to finish this, or somebody else will. Software development is an iterative process :) In the meanwhile, everyone using Nodequeue 3.x right now can already apply the current patch and get on with their lives. Thanks a lot for your work so far on this issue!
Tip: if you post a patch it is best to set the issue status to "Needs review", this triggers a test on the test bot.
Comment #13
santhony CreditAttribution: santhony commentedI am getting an error that I think may be related to this:
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'qid' in 'field list': SELECT qid, name FROM {nodequeue_queue}; Array ( ) in _fe_nodequeue_get_qid_map() (line 224 of /home/ceigreen/public_html/modules/features_extra/fe_nodequeue.module).
Would the patch in this case work for me as well? I've tried nodequeue-7.x-2.x-dev and updated php with no success...
Comment #14
alexharries CreditAttribution: alexharries commentedThe patch in #10 has fixed this problem for me, too - thank you :)
Comment #15
AltaGrade CreditAttribution: AltaGrade commentedThe patch in #10 works, but when applied to dev branch gives:
Also I had to
cd sites/all/modules/nodequeue/features_extra/fe_nodequeue
first, because the patch does not apply from the modules root.