Problem/Motivation

This Drupal 7 site (recently updated) uses MySQL and has one admin account. Draggableviews produces an error when saving. This occurs only in one site of a multisite installation. This multisite installation has three sites (call them alpha-site or default, wiskey-site, xray-site). Adding a Draggableview administration page to an existing View creates an error when saving and displays the same error in preview area:

SQLSTATE [42S22]: Column not found: 1054 Unknown column 'draggableviews_structure.weight' in 'field list'. 

More specifically when constructing the DgV the error appears immediately in the preview area when DgVs is added to the Sort Criteria and not when DgVs is added to as a Field).

I Created a test View in the a-site with Draggableviews that works without any errors.

I Created a second test in the x-site. This view is saved without error. The Draggable content page is displayed correctly, but once the new sort is saved a different error is reported:
Notice: Undefined offset: 1 in draggableviews_constexual_links_view_alter() (line 181 of /var/www/php/drupal7/sites/all/modules/draggableviews/draggableviews.module).

Proposed resolution

What did't work.
A search for similar "unknown column" errors frequently pointed to References module. I updated with drush upc, drush updatedb, and drush cc all. I've uninstalled every module and re-enabled the absolute minimum required for DgVs. Then, I ran a diff on drush pml of both sub-sites until they were identical. Enabled Seven theme. I re-made the original view in the w-site.

If its not a bug, then how to troubleshoot may be good for docs.
It may be the case this is not a problem in the code. Then I propose whatever the solution, troubleshooting instructions may be useful for the documentation. I don't know enough about what's under the hood of DgVs to say a single site would have a one-in-three chance of no error success.

UPDATE:
This site had the previous iteration of Draggableviews and it seems to have a left over table, too. Here is a no-data mysql dump, the export parred down to just DgVs mentionables, [pastebin]

Remaining tasks

User interface changes

API changes

Comments

xtiansimon’s picture

Issue summary: View changes

edit grammar logic

xtiansimon’s picture

Issue summary: View changes

Performed a second test on the last multisite of this installation to mixed results.

xtiansimon’s picture

Issue summary: View changes

added sub-title

xtiansimon’s picture

Issue summary: View changes

syntax error

xtiansimon’s picture

Anyone?

ygerasimov’s picture

Status: Active » Fixed

Thank you very much for your extensive report.

Looking at your pastebin I see table names draggableviews_collapsed and draggableviews_structure that are left overs from 7.x-1.x branch.

Could you please reinstall draggableviews 7.x-2.x-dev version (manually removing these two tables before installation)? It should have only one draggableviews_structure table that has different schema.

The Notice you have has been fixed lately.

Please reopen this issue if you still have any problems.

xtiansimon’s picture

Status: Fixed » Active

UPDATE: After following suggestion, problems persist; however, for good or bad, the working sub-site no longer operates correctly and is now showing the *same* errors.

I have formalized my testing of the site (and included this in the pastebin link). In 2/3 successive rounds of tests, both sites and their "sort" pages show the drag handles, can be resorted, the new order saved (as shown in the mysql tables); however, the site HTML page does not change.

On a side note, the reason I formalized the test plan was because, for a brief time after the first round of suggested changes, "$drush cc all" fixed one of the sites. However, after constructing the formal test plan, and rerunning the test (rounds 2 and 3), both sites behave the same--neither will display the reordered items different then their creation order. "drush cc" was only temporarily effective. Yet it did raise an interesting point for me. I had also uninstalled views & views_ui with draggableviews module. And throughout all tests rounds, the Views Advanced setting turning off JavaScript overlay has remained in effect. I'm happy my tests didn't have to require me to continually disable JS overlay (simply to ensure the errors were displayed when they are generated). It was nevertheless unexpected after the complete Views uninstall.

This is beyond my understanding of Views and I hope I can find some relief soon.

http://pastebin.com/0hFL08f5

ygerasimov’s picture

Status: Active » Postponed (maintainer needs more info)

As you have multisite installation please advise what tables do you share between your sites?

Can you also try to use Field API handler instead of Native?

babbage’s picture

I had exactly the same issue, due to tables that were carried over from an earlier Drupal 6 version of the site. Disabling and uninstalling the module and then re-installing the 7.x-2.x branch immediately fixed the problem. This is definitely to do with the left-over schema from the previous version.

honigferd’s picture

Thank you! This was exactly my problem and your solution fixed it.

istryker’s picture

Status: Postponed (maintainer needs more info) » Fixed

I know one table was removed in latest dev when upgrading from 7.x-1.x to 7.x-2.x. It seems to be fixed. I am closing this issue. Reopen if you are still having a problem.

There is another issue able 'Unknown Columns' see #1787764: Unknown column caused by orderby alias not matching field alias.

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

Anonymous’s picture

Issue summary: View changes

Added additional information