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: Publisher tables aren’t updated properly when moving an entry from one channel to another

Status Resolved
Add-on / Version Publisher 1.6.4
Severity
EE Version 2.10.1

Stephen Tidmore

Mar 10, 2016

Description:

We have two channels that share the same channel fields and some entries are being moved from one channel to another in the Control Panel. When we move the entries, it seems like the exp_channel_data and exp_channel_titles tables reflect the channel id in the channel_id column, but the exp_publisher_data and exp_publisher_titles tables do not reflect the change. They still show the original channel in the channel_id column, which is causing some problems with those entries on the site.

Detailed steps to reproduce the issue:
1. Install Publisher
2. Create two channels that share the same field group
3. Create an entry in one of those channels.
4. After creating the entry, go back into the entry, then to the Options tab and choose the other channel from the Channel dropdown, then save the entry.
5. Go look at the exp_channel_data and exp_channel_titles table - the channel_id columns should show the new channel id.
6. Go look at the exp_publisher_data and exp_publisher_titles columns - the channel_id columns are still showing the old channel id.

Are you able to confirm this? I’ve checked in a couple of different environments and see the same thing.

Thanks for taking a look.

Stephen

#1

BoldMinded (Brian)

That sounds like it could be a legitimate issue. I’ll try to take a look at it this weekend.

#2

BoldMinded (Brian)

I haven’t replicated it, but I looked at the code that handles this and it is accepting the channel_id from the POST data, so it should update accordingly. You’re changing the channel on the normal entry publish page, right?

#3

Stephen

Hi Brian,

Yes, I’m changing the channel in the Options tab on the normal entry publish page. I just tested a few more times to be sure I wasn’t going crazy yesterday and was able to replicate this again in the same way.

Thanks! Stephen

#4

BoldMinded (Brian)

It seems that field posts as “new_channel” and not “channel_id”. The next comment will have a link to a fixed build for you.

#5

BoldMinded (Brian)

Comment has been marked private.

#6

Stephen

Hi Brian,

I upgraded to the new build you sent and this seems to have fixed the issue. Thanks for the quick fix. Now it’s on to figure out a query to update all those entries where the channel ids don’t match between the tables.

Thanks! Stephen

#7

Stephen

Hi Brian,

I wanted to re-open this ticket because I found another issue that is related to this one. I’m also using Low Search and the Publisher Low Search extension on this site. I noticed the moving an entry from one channel to another also wasn’t updating the collection ID in the exp_low_search_indexes table so I worked with Low on a fix which he provided here https://getsatisfaction.com/low/topics/search-indexes-arent-being-updated-when-moving-an-entry-from-one-channel-to-another-in-the-cp.

His fix works whenever the Publisher Low Search extension is disabled, but when that extension is enabled the rows in the exp_low_search_indexes table for that entry are being removed but they aren’t being re-added to the table at all so the entries are no longer included in search results. I took a look at the code for the Publisher Low Search extension and didn’t see anything obvious (to me) that would be a quick fix. Could you take a look?

Thanks for the help.

#8

BoldMinded (Brian)

Is the collection_id the column value that is updated in the exp_low_search_indexes table when the entry is moved from channel A to B? Usually the collection_id is the same as the channel_id.

FYI, its going to be a few days before I can dig into this. Playing catch up after starting a new job this week.

#9

BoldMinded (Brian)

Stephen, don’t know if you’ve seen Low’s response, but if he won’t add a hook then this may not be something I can fix. I’ll give it a look this weekend and let you know.

#10

Stephen

Thanks Brian. Congratulations on the new job - no worries about looking into this in a few days. To answer your earlier question, yes, the collection_id is the column in the exp_low_search_indexes table that should be updated when an entry is moved from one channel to another. The collections map to channel ids, but they aren’t necessarily the same ID number. So when I move an entry from one channel to another the collection_id in the exp_low_search_indexes table is updated to match the new channel the entry is in. When I have the Publisher Low Search extension enabled the row is being deleted fine with the new line Low added in, but it’s not be re-added. With Publisher Low Search disabled the row is re-added with the new collection_id reflected in that column.

Let me know if you have any other questions or if you think it’s possible to fix it without the hooks in Low Search.

Thanks! Stephen

#11

BoldMinded (Brian)

Stephen, sorry again for the delay. My site isn’t sending email notifications so I’m a bit behind. Is this still a show stopper for you? Is deleting the index and starting it from scratch after moving entries a workable solution?

#12

Stephen

Hey Brian - thanks for checking in. It’s not a show stopper for us - we can deal with deleting the entries in the collection and re-indexing periodically for now. It’s not perfect because the users who are moving entries don’t have access to the Low Search module in the CP, but it’s not a huge deal for someone else to re-index the entries every day or two.

Thanks! Stephen

#13

BoldMinded (Brian)

I realize its been a long time, but I just checked this functionality in EE3 and it does move entries to a new channel correctly when saving an entry. EE3 does not have a batch move option yet though, however, if it uses the new event hooks like everything else is, then this should take care of itself if they add batch editing back.

Login to reply