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: Can’t re-create deleted pages (duplicate pages uri)

Status Resolved
Add-on / Version Publisher 1.0.12
Severity Blocker
EE Version 2.6.1

Nick Lane

Oct 14, 2013

We’ve hit a serious bug that’s effecting pages which are deleted and then attempted to be re-created. When we try to publish a new page, and use a previous URI, we are greeted with the “Duplicate Pages URI” message. Digging into the site_publisher_site_pages table, we noticed that none of the past URIs were deleted when the pages were. This was for both the “open” and “draft” rows.

We’re running EE 2.6.1, Publisher 1.0.12, and Pages Module 2.2

Thanks!

#1

BoldMinded (Brian)

Nick, thanks for reporting this and sorry you’re having this issue. Looking back at the code it looks like something I forgot to add. I’m at the EE conference right now so I’m not sure when I’ll be able to dive into this, but I’ll try to have a fix for you by the end of the week if thats OK?

#2

BoldMinded (Brian)

Nick, I’m losing it. I just found the spot of code where this should be taken into account… I didn’t completely overlook it. I’ll try to replicate it locally and see what the issue might be.

#3

BoldMinded (Brian)

Are you using URL Translations?

#4

BoldMinded (Brian)

If you are not using translated urls try this… go to line 1001 of models/publisher_site_pages.php and change it from this:

if ( !ee()->publisher_setting->get('url_translations') || !$this->is_installed())

to this:

if ( !$this->is_installed())

And see if that works. It should work for newly saved entries, but not the old ones. If this works for newly saved entries I’ll try to come up with something to fix the old entries for you.

#5

Nick Lane

No, we are not using URL translations. Thanks, I will attempt your quick edit!

If needed, I can manually remove the older entries from the arrays, but was hoping there might be a workaround.

#6

Nick Lane

Tested on newly created pages, works great. Thank you! This just leaves the prior pages to resolve.

#7

BoldMinded (Brian)

Awesome! Are the prior pages something you can fix out yourself or do you need a script to fix it?

#8

BoldMinded (Brian)

Following up. If you still need to delete those strays open up your ext.publisher.php file and set $debug = TRUE; then go to the debug() method and in there add something like the following:

foreach (array(1,2,3,4) as $eid) {
     ee()->publisher_site_pages->delete($eid);
}

That should clean up the strays.

I’m going to go ahead and close this ticket because it sounds like you’re all set with the saving new entries and this code should help remove the strays. If you have any other questions just reopen the ticket or submit a new one. Thanks!

Login to reply