Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: SQL Error on special channel

Status Resolved
Add-on / Version Publisher v1.2
Severity Blocker
EE Version v2.7.3 - Build Date: 20131210

Julian Nischler

Feb 20, 2014

After upgrading to version 1.2 I am now getting this SQL error whenever I try to publish a new entry or try to edit an entry:
This only happens with the channel “Downloads” all other channels are working.
Another strange thing this channel isn’t even managed by publisher.
On my SQL server the table exp_publisher_relationships has the columns:
rel_id
rel_parent_id
rel_child_id
rel_type
rel_data
reverse_rel_data
publisher_lang_id
publisher_status
publisher_status
Thank you very much!
Regards Julian Nischler
Once again 😉


A Database Error Occurred
Error Number: 1054
Unknown column ‘parent_id’ in ‘where clause’
DELETE FROM `exp_publisher_relationships` WHERE `parent_id` = 477 AND `field_id` = ‘38’ AND `publisher_lang_id` = ‘1’
Filename: third_party/publisher/libraries/Publisher/hooks/Publisher_relationship_hooks.php
Line Number: 264
« Back

#1

BoldMinded (Brian)

Did you recently upgrade to EE 2.6? It looks like it didn’t migrate the data properly.

#2

Julian Nischler

yes this is true!

#3

Julian Nischler

i upgraded to EE 2.7

#4

BoldMinded (Brian)

Not sure why the updates didn’t trigger, but you may need to run these queries manually. But first, make sure you click the “Run Module Updates” button on the Modules page. Also, before running these queries make sure you backup your database please.

ALTER TABLE `exp_publisher_relationships` CHANGE `rel_id` `relationship_id` int(10) auto_increment
ALTER TABLE `exp_publisher_relationships` CHANGE `rel_parent_id` `parent_id` int(10)
ALTER TABLE `exp_publisher_relationships` CHANGE `rel_child_id` `child_id` int(10)
ALTER TABLE `exp_publisher_relationships` ADD `field_id` int(10) NULL AFTER `child_id`
ALTER TABLE `exp_publisher_relationships` ADD `order` int(10) DEFAULT 0 AFTER `field_id`
ALTER TABLE `exp_publisher_relationships` DROP COLUMN `rel_data`
ALTER TABLE `exp_publisher_relationships` DROP COLUMN `rel_type`
ALTER TABLE `exp_publisher_relationships` DROP COLUMN `reverse_rel_data`
#5

Julian Nischler

I was using a quite old version of EE i think 2.2 and upgraded to 2.7. I tryed Run Module Updated with no change! Okay thank you i will give it a try!

#6

Julian Nischler

Hey, The query fixed the sql error. However, as now the field_id is always null meaning every relationship is now unset! I need to find a way to find a way to recover the relationship data. Thanks!

#7

BoldMinded (Brian)

Glad it fixed the error. To recover the data just look at the exp_relationships table. It should be exactly the same columns as exp_publisher_relationships except now it has the publisher_ prefixed columns. You should be able to migrate the entries from exp_relationships to exp_publisher_relationships.

#8

Julian Nischler

Okay thanks I was able to migrate the data 😉

Now I am getting a new error. By the way, the cms displays the content correctly. However, the frontend dos not: L0 points to exp_publisher_relationships but grid field columns are only inside the exp_relationships table. By the way I have already disable the grid module as I don’t need it! Error Number: 1054

Unknown column ‘L0.grid_field_id’ in ‘field list’

SELECT DISTINCT L0.field_id as L0_field, L0.grid_field_id as L0_grid_field_id, L0.grid_col_id as L0_grid_col_id, L0.grid_row_id as L0_grid_row_id, L0.parent_id AS L0_parent, L0.child_id as L0_id FROM (exp_publisher_relationships as L0) LEFT JOIN exp_publisher_relationships as L1 ON L0.child_id = L1.parent_id OR L1.parent_id = NULL WHERE L0.grid_field_id = 0 AND L0.parent_id IN (477, 472, 471, 470, 469, 468, 467, 466, 465, 464, 463, 462, 461, 460, 457, 456, 455, 454, 453, 451, 450, 445, 427, 426, 425, 424, 423, 422, 421, 420, 417, 416, 415, 414, 413, 412, 411, 410, 409, 408, 400, 399, 397, 398, 396, 395, 394, 393, 392, 391, 390, 389, 388, 387, 386, 385, 169) ORDER BY L0.order asc

Filename: third_party/publisher/libraries/Publisher/hooks/Publisher_relationship_hooks.php

Line Number: 65

#9

Julian Nischler

I now just created the columns: grid_field_id grid_col_id grid_row_id

seems to be working!

#10

Julian Nischler

now the sql error is gone but i am unable to get any data out of a relationship!

#11

Julian Nischler

okay got it! i created the grid fields with null not 0, …. only works with 0! grid_field_id grid_col_id grid_row_id

Login to reply