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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bmeme’s picture

Status: Active » Patch (to be ported)
FileSize
1.1 KB

Here is the patch!

pfrenssen’s picture

Status: Patch (to be ported) » Needs review

Status: Needs review » Needs work

The last submitted patch, features_extra-fix_fe_nodequeue_export-2050119.patch, failed testing.

pfrenssen’s picture

The test fails because this patch is not backwards compatible with Nodequeue 7.x-2.x:

exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 's.name'

bmeme’s picture

Attached 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...

pfrenssen’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, features_extra-fix_fe_nodequeue_export-2050119.patch, failed testing.

pfrenssen’s picture

Status: Needs work » Needs review

There'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.

pfrenssen’s picture

Status: Needs review » Needs work
bmeme’s picture

Status: Needs work » Patch (to be ported)
FileSize
1.78 KB

Sorry 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.

pfrenssen’s picture

Status: Patch (to be ported) » Needs review

Sure, 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.

Status: Needs review » Needs work

The last submitted patch, features_extra-fix_fe_nodequeue_export-2050119.patch, failed testing.

santhony’s picture

Issue summary: View changes

I 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...

alexharries’s picture

The patch in #10 has fixed this problem for me, too - thank you :)

AltaGrade’s picture

The patch in #10 works, but when applied to dev branch gives:

git apply features_extra-fix_fe_nodequeue_export-2050119_1.patch
fe_nodequeue/features_extra-fix_fe_nodequeue_export-2050119_1.patch:15: trailing whitespace.
      $query = db_select('nodequeue_queue', 'q');
fe_nodequeue/features_extra-fix_fe_nodequeue_export-2050119_1.patch:16: trailing whitespace.
      $query->innerJoin('nodequeue_subqueue', 's', 'q.title = s.title');
fe_nodequeue/features_extra-fix_fe_nodequeue_export-2050119_1.patch:17: trailing whitespace.
      $query->addField('q', 'name', 'name');
fe_nodequeue/features_extra-fix_fe_nodequeue_export-2050119_1.patch:18: trailing whitespace.
      $query->addField('s', 'sqid', 'qid');
fe_nodequeue/features_extra-fix_fe_nodequeue_export-2050119_1.patch:23: trailing whitespace.
    
warning: squelched 1 whitespace error
warning: 6 lines add whitespace errors.

Also I had to cd sites/all/modules/nodequeue/features_extra/fe_nodequeue first, because the patch does not apply from the modules root.