When adding an image gallery, this warning is returned:
user warning: Unknown column 'field_advgallery_nid' in 'field list' query: INSERT INTO drupal_content_field_advgallery (vid, nid, delta, field_advgallery_nid) VALUES (252, 220, 0, NULL) in .../sites/all/modules/cck/content.module on line 1213.
When entering the Edit Gallery tab, this warning is returned:
user warning: Unknown column 'ag.field_advgallery_nid' in 'on clause' query: SELECT DISTINCT(n.nid) AS nid, n.created, n.vid, n.title, ag.delta AS delta, f.fid, f.filename, f.filepath, f.filemime, f.filesize FROM drupal_node n INNER JOIN drupal_content_type_advimage ai ON n.nid=ai.nid AND n.vid=ai.vid INNER JOIN drupal_files f ON f.fid=ai.field_advimage_fid LEFT JOIN drupal_content_field_advgallery ag ON n.nid=ag.field_advgallery_nid LEFT JOIN drupal_node n1 ON n1.vid=ag.vid and n1.nid=ag.nid WHERE n.uid=1 AND n.type='advimage' AND (n1.nid IS NULL) ORDER BY n.created DESC LIMIT 0, 10 in .../sites/all/modules/advimage/advimage.edit.inc on line 486.
The table has a nid field, but not a field named field_advgallery_nid.
I'm not sure what the correct solution is, for example adding the field to the database (if that, how should it be defined?) or changing the code. Could you please advise?
Thank you. It looks like a very useful module, so I'm hoping to include it in a site due to be implemented in a few days.
Comments
Comment #1
Ilya1st CreditAttribution: Ilya1st commentedwhich cck version do you use?
Comment #2
Ilya1st CreditAttribution: Ilya1st commentedComment #3
Ilya1st CreditAttribution: Ilya1st commenteddesc content_field_advgallery;
+----------------------+------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------------------+------------------+------+-----+---------+-------+
| vid | int(10) unsigned | NO | PRI | 0 | |
| nid | int(10) unsigned | NO | MUL | 0 | |
| delta | int(10) unsigned | NO | PRI | 0 | |
| field_advgallery_nid | int(10) unsigned | YES | MUL | NULL | |
+----------------------+------------------+------+-----+---------+-------+
4 rows in set (0.05 sec)
on a new fresh installation. it STANDARD nodereference CCK structure. I don't know what's wrong on your side.
Your CCK version? (I use latest stable). Also "show create table content_field_advgallery" in your mysql.
Also checkout 2.5 release - http://drupal.org/node/1199758
Do not test on -dev
There may be unstable code and drupal.org has some issues with rebuilding -dev packages
Comment #4
ailgm CreditAttribution: ailgm commentedThanks for your quick responses. I have version 6.x-3.0-alpha3 of CCK installed.
Here's the create table statement:
CREATE TABLE `content_field_advgallery` (
`vid` int(10) unsigned NOT NULL default '0',
`nid` int(10) unsigned NOT NULL default '0',
`delta` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`vid`,`delta`),
KEY `nid` (`nid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
I've now installed release 2.5, which did not add the field to the table.
Could you perhaps give me the SQL to add the field and adjust any indexes it should be in?
Comment #5
Ilya1st CreditAttribution: Ilya1st commenteddrop advimage and advgallery types and reinstall modules.
so we need add new issue about work with fields.
Comment #6
Ilya1st CreditAttribution: Ilya1st commentedwell.
understood whats wrong.
we must build queries(fields there) accordingly to database info from that's functions.
so it's really a bug cause database structure can change as i see. that.
Thank you for your work.
Comment #7
Ilya1st CreditAttribution: Ilya1st commented+----------------------+------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------------------+------------------+------+-----+---------+-------+
| vid | int(10) unsigned | NO | PRI | 0 | |
| nid | int(10) unsigned | NO | MUL | 0 | |
| delta | int(10) unsigned | NO | PRI | 0 | |
| field_advgallery_nid | int(10) unsigned | YES | MUL | NULL | |
+----------------------+------------------+------+-----+---------+-------+
4 rows in set (0.00 sec)
just have tested CCK 3.0.
All structures are same as with 2.x
you're wrong there all works properly.
Bug invalid.
Comment #8
ailgm CreditAttribution: ailgm commentedWell, it didn't work properly for me, so in that sense I'm not wrong. I appreciate you trying to figure out why.
Working from your suggestion in #5 to drop the types and reinstall the modules, I did this:
- disable the modules
- uninstall the modules
- manually drop the three tables I saw in the database related to these modules: content_field_advgallery, content_type_advgallery and content_type_advimage
- re-enable the modules (many warnings then appeared) - specifically these three: advimage, advimage_up and advupload
- checked the database and found four (instead of three tables) -- an extra one I didn't have before: content_field_advimage, and found that the content_field_advgallery table was created with the additional field I didn't have before.
Now when I create a gallery and go to the Edit gallery tab, this warning appears:
user warning: Unknown column 'ai.field_advimage_fid' in 'on clause' query: SELECT DISTINCT(n.nid) AS nid, n.created, n.vid, n.title, ag.delta AS delta, f.fid, f.filename, f.filepath, f.filemime, f.filesize FROM node n INNER JOIN content_type_advimage ai ON n.nid=ai.nid AND n.vid=ai.vid INNER JOIN files f ON f.fid=ai.field_advimage_fid LEFT JOIN content_field_advgallery ag ON n.nid=ag.field_advgallery_nid LEFT JOIN node n1 ON n1.vid=ag.vid and n1.nid=ag.nid WHERE n.uid=1 AND n.type='advimage' AND (n1.nid IS NULL) ORDER BY n.created DESC LIMIT 0, 10 in .../sites/all/modules/advimage/advimage.edit.inc on line 486.
The create table statement for that table is:
CREATE TABLE `content_type_advimage` (
`vid` int(10) unsigned NOT NULL default '0',
`nid` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`vid`),
KEY `nid` (`nid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
Could you please look at this and let me know if you have a suggestion? Thanks.
Comment #9
Ilya1st CreditAttribution: Ilya1st commentedAs CCK 3.0 is not in stable status use 2.x for correct work.
The right nodereference structure is as I wrote before. And even with CCK 3.0 I could not reproduce you bug. It may depend on other modules you use in alpha or beta state :)
try drop content_type_advimage too/ try test modules on clean drupal distribution and see tables there
Comment #10
ailgm CreditAttribution: ailgm commentedI've done as you suggested, installing this on another site with CCK 2.9 instead of 3.0.
Just as happened with the first installation, these database objects weren't created:
1) the table content_field_advimage
2) the column field_advgallery_nid in content_field_advgallery, and
3) the column field_advimage_fid in content_type_advimage
Could it be a matter of which modules I'm selecting within admin/build/modules, or that I'm enabling all of them simultaneously? For some reason, it seems that some of the SQL statements needed to set up the database aren't being executed.
Could you please provide the create table statements that are supposed to run for each table?
Comment #11
Ilya1st CreditAttribution: Ilya1st commentedthat are CCK standard structures created by CCK. all calls to create that types were added to advimage_install hook.
okay. looking on clear site.
show create table content_field_advgallery;
| content_field_advgallery | CREATE TABLE `content_field_advgallery` (
`vid` int(10) unsigned NOT NULL DEFAULT '0',
`nid` int(10) unsigned NOT NULL DEFAULT '0',
`delta` int(10) unsigned NOT NULL DEFAULT '0',
`field_advgallery_nid` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`vid`,`delta`),
KEY `nid` (`nid`),
KEY `field_advgallery_nid` (`field_advgallery_nid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
show create table content_type_advimage;
| content_type_advimage | CREATE TABLE `content_type_advimage` (
`vid` int(10) unsigned NOT NULL DEFAULT '0',
`nid` int(10) unsigned NOT NULL DEFAULT '0',
`field_advimage_fid` int(11) DEFAULT NULL,
`field_advimage_list` tinyint(4) DEFAULT NULL,
`field_advimage_data` text,
PRIMARY KEY (`vid`),
KEY `nid` (`nid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 |
СCK 6.x-2.9
advimage latest stable.
What I'm doing wrong?
Comment #12
ailgm CreditAttribution: ailgm commentedThanks. I added the last three fields (using an alter table statement) to content_type_advimage, and the error message no longer appears. Perhaps someone else can provide a reproducable case.
Comment #13
Ilya1st CreditAttribution: Ilya1st commentedadding images and other thing work properly?
Comment #14
ailgm CreditAttribution: ailgm commentedAs per my posting in the advupload issue queue, now I've run into a Page not Found error uploading, so that's where I'm stuck now.
Comment #15
Ilya1st CreditAttribution: Ilya1st commentedreopen again.
http://www.drupal.ru/node/58089
Comment #16
arturus-1 CreditAttribution: arturus-1 commentedI have a similar problem, the tables do not create fields
1) field_advimage_fid (tables - photo_content_type_advimage)
2) field_advgallery_nid (tables - photo_content_field_advgallery)
I disabled modules:
Image 6.x-1.1
Image Attach 6.x-1.1
Disabled and deleted Advanced gallery
Reinstalled the module Advanced gallery
After this Advanced gallery established and is working normally
Comment #17
Ilya1st CreditAttribution: Ilya1st commented