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 Draft issues and data

Status Resolved
Add-on / Version Publisher Lite 3.1.5
Severity
EE Version 5.3.2

James Brown

Aug 04, 2020

Hello-
I’m having some issues around drafts. I’m just bundling the things I’ve seen into one ticket here. For my draft settings I have “Default view state” and “Default save status” both set to “Draft”, “Publish previews” are turned on, “Authorized draft previews” is on, “Authorized draft preview handling” is set to “Graceful”, and “Sync Drafts” is on.

1. A big one is with Assets fields. I have a field that allows the upload of a single image. I create a new entry, upload an image, set the Save as to Published and click Save. The page refreshes, is showing the Draft header, but when I scroll down, the Assets field doesn’t have the image I uploaded. If I switch to View as Published, then I see the image. So it seems like the draft is deleting out the Assets fields.

2. I have an existing published entry. I go in and make some changes and Save as a Draft. I decide I don’t like the changes and click the blue “Delete Draft” button. The page refreshes and all the content except the Structure URL is gone (see attached screenshot). Also gone is the dropdown to view the published page. That only option I have is Save as Draft or Published. Refreshing the page yields the same result. If I actually go to the URL I will see the content before it was deleted, but going to the actual entry in the control panel shows as if nothing was there. I can recover the page by going into my revisions. But definitely scary!

3. This one is similar to #2. But I’ve noticed some pages when I open them are blanked out in a similar fashion. But these are pages that I haven’t touched and never had drafts on. They existed before Publisher was even turned on.

Thanks!
James

#1

BoldMinded (Brian)

James can you record a screencast of each issue as a separate video? I’d like to see it in person so I know what I have to replicate locally.

#2

James Brown

Comment has been marked private.

#3

James Brown

I was just looking through the site and it looks like quite a few channels have the issue I described in #3. Publisher was installed as one of the last phases of the site (since we didn’t need the functionality during development). So I had all the content in place and then turned on Publisher. I also did some tweaks to the Draft settings. Mainly changing the “Default view state” and “Default save status”. At some point I did also notice that most of the channels did not have “Draft” as one of their available statuses. I noticed when I was trying to Save a Draft and Preview on entries and was having issues. So I went through and made sure that status was enabled on all channels. That’s all the actions I can think of that happened regarding Publisher.

#4

BoldMinded (Brian)

Since you mentioned several different scenarios here this might take me a few days to dig into. I have to replicate each scenario locally before I can determine what the fix might be.

#5

BoldMinded (Brian)

After you installed Publisher did you continue to step 2 of the installation process? Step 2 migrates all data to the Publisher tables. If you’re unsure if you did this then open the exp_publisher_titles table and you should see a row in it that matches each row in the exp_channel_titles table (there may be some additional draft rows in there too). At minimum you should have a row with the status of “open” and lang_id of “1” (even if this not a multi-lingual site) for each row in the exp_channel_titles table. If this is not the case, then you may need to uninstall Publisher and reinstall it (backup your db), and make sure you finish step 2.

#6

James Brown

Yea, I did do Step 2. In the add-on admin section of Publisher and go to Step 2 under Utilities it does say: Good to go! Publisher installation is complete!

#7

BoldMinded (Brian)

Ok, so for one of the entries that you’re having issues with, do you see it’s row in the exp_publisher_titles table with the status of “open”?

#8

BoldMinded (Brian)

I did a test locally, and if there is an open row in exp_publisher_titles, but no draft row, it should still display the data: https://www.dropbox.com/s/kdiwhagxeyqauvj/ticket-2146-publisher-drafts.png?dl=0

#9

BoldMinded (Brian)

Comment has been marked private.

#10

James Brown

Sorry for the delay. I looked at the exp_publisher_titles, the numbers seems to be accurate. There’s about 1700 entries in there and they all have a status of open (and a handful of drafts) and a lang_id of 1. I’ll attach to the main ticket description a screenshot of the exp_publisher_titles database entry and what it looks like when I open that entry in the control panel. But you’ll see that the database entry looks correct, but opening the entry everything is blank.

#11

James Brown

ok, I installed that update. Everything updated fine, but now there’s no on the entry pages there’s no Publisher dropdowns at all. I looked in the inspector and I do see a js error. I assume it’s the cause. The error says:

Uncaught TypeError: Publisher.isEE6 is not a function at HTMLDocument.<a> (admin.php?/cp/publish/create/1&template_id=5&parent_id=0:703) at l (jquery.js?v=1588098606:3) at Object.fireWith [as resolveWith] (jquery.js?v=1588098606:3) at Function.ready (jquery.js?v=1588098606:3) at HTMLDocument.s (jquery.js?v=1588098606:2)

#12

BoldMinded (Brian)

Make sure you clear your browser cache.

#13

James Brown

I tried clearing my cache and got the same result. I even tried a browser that I haven’t used to access the control panel before with the same result.

#14

BoldMinded (Brian)

Can you use the inspector and find out what line that js error is on?

#15

James Brown

This is the section in the HTML it is having issues with.

[removed]$(function(){ var $form = $(‘form[action*=”\/cp\/publish”]’); var $tabField = $(“form”).find(“.publisher-toolbar-tab”); var $content = $tabField.closest(“.setting-field, .field-control”).html(); var $tab = $tabField.closest(“.tab”); var tabClass = $tab.attr(“class”); var tabId = tabClass.match(/t-(\d)/); var $tabControl = $(“ul.tabs, .tab-wrap”).find(“[rel=t-“+ tabId[1] +”]”); var $breadCrumbs = $(“section.wrap .breadcrumb”); $tab.remove(); $tabControl.remove(); if (Publisher.isEE6()) { $(“.ee-main__content .tab-bar”).after($content); } else { $(“section.wrap”).prepend($content); } $form.publisherToolbar(); });[removed]

#16

BoldMinded (Brian)

Comment has been marked private.

#17

James Brown

Ok, Publisher is back!

Below is what I see when I do scenario #2. So doing the steps I mentioned, when I delete the draft of a published page it still goes a bit funny and deletes out the field data and the title. But now at least it is leaving the Asset field data. So it does seem to have fixed issue #1. The same is true of issue #3. When I open one of those existing entries all the fields are blank except for Assets fields which now have data.

So success in the first item! The other 2 still have issues.

http://anomali.com/files/Screen_Recording_2020-08-05_at_1.10.42_PM.mov

#18

BoldMinded (Brian)

After you delete the draft what is the URL in your browser?

#19

James Brown

https://www.domain.com/admin.php?/cp/publish/edit/entry/4912&lang_id=1&status=open

#20

BoldMinded (Brian)

I’m unable to replicate this in 2 different environments. Besides Assets, what other add-ons do you have installed? Have you tried creating a new EE install with just the bar minimum to replicate the issue? Just Publisher installed (default settings), 1 channel, 1 custom field, then see if it happens in a new environment. If I can’t replicate the issue this is usually the next step in the process, otherwise I’m spinning my wheels.

I’m also seeing that your current Publisher license is expired.

#21

James Brown

Well definitely need to get that renewed! I’ll see what I can do about setting up another instance.

#22

BoldMinded (Brian)

Is the current instance on a public server somewhere? If so I can login to take a look, but if I don’t spot anything quickly I won’t spend a ton of time digging around… debugging a remote environment is kind of hard.

#23

James Brown

sure, what’s the best way to send that to you? And what is you preference for email to use?

#24

BoldMinded (Brian)

Edit the ticket and add all server creds in the provided fields. They’re emptied when the ticket is closed, instead of it being in my inbox.

#25

James Brown

ok, I put the credentials in. I also made sure I was renewed! You need something in the control panel that indicates that. I had no idea. 😊

#26

James Brown

So I found another issue with the Drafts that seems to be tied specifically to Structure Listings (as opposed to static pages). I created a recording. But basically anytime after a new structure listings has been published, if I go in and make edits and save them as Published, the live page on the site (which used to work) now becomes a 404. Looking at the entry itself in the control panel everything seems correct, the entry comes up with all the fields filled, there’s a Structure URL Title, the Status is Open, etc. But no matter what I do the actual site shows a 404. Even reverting back to a previous version and saving show a 404.

http://anomali.com/files/Screen_Recording_2020-08-05_at_4.34.28_PM.mov

I do now have a copy of production in a new environment that I can point you to if that would be of more help.

#27

James Brown

Comment has been marked private.

#28

James Brown

That last 404 issue seems the most serious as once it happens, I can’t find any way to cause the entry to come back on the front end. I end up having to delete the entru and recreate it every time I need to make an edit.

#29

BoldMinded (Brian)

It’ll be a few days before I can really spend time on this. You’ve reported several little issues, and based on experience I just know it’ll take time to investigate.

Take a look at the exp_publisher_site_pages table, and there will be a JSON object in there for the draft and open status of your pages. See if the URL you’re expecting is in those objects. If they are, then something else is likely causing the 404. If they are not in the JSON object, then that at least gives me something to focus on.

If you’re able to replicate these issues in a new/clean EE environment it would help immensely. Coming into a fully built out environment with other add-ons, template logic etc creates a lot of noise and makes it more difficult to troubleshoot. If you’re unable to replicate them in a new environment, it could also be a good indicator that something could be conflicting, or there is just something specific to that environment that is causing the problem, which is also helpful too in narrowing down the issues.

#30

James Brown

ok, so I followed the steps to make one of the listing pages 404. When I look in both the open and draft arrays, I see 2 items in each for the entry id. One has the url and one just the id.

“4918”:”\/blog\/test-entry-blog” “4918”:1

#31

BoldMinded (Brian)

Which one has which? The second ID 4918 is probably referring to the template_id that is used to display that URL.

Is the url value in the open and draft version of the JSON object both “\/blog\/test-entry-blog”?

#32

James Brown

Both the draft and open rows in exp_publisher_site_pages have those 2 value. 4918 is the entry_id.

But your comment made me assume that maybe the 1 in “4918”:1 is the template id. So I did another test. I looked at that array after the initial publish (when the entry actually displays on the front end). At that point what I assume is the template id was 13. Once I publish the entry a second time that value is changed to 1. So that explains the 404 (as that is the wrong template). So it appears this error is somehow being caused by the template id being changed.

While checking on this I made another discovery, for the listing pages I had the Structure Template hidden on the layout. I unhid it so I could see what was going on. Unhiding that actually fixed the issue on a subsequent test entry. So it seems that the error is being caused by the Structure Template being hidden. Initial publishes work fine, but additional publishes set the template id to 1.

Does that help?

#33

James Brown

This appears to be a Structure issue. In the staging environment I disabled Publisher entirely and it has the same behavior.

So that takes care of that issue. Although now I have a problem of how do I bulk update the exp_publisher_site_pages template IDs?

#34

BoldMinded (Brian)

When you save an entry in Publisher it will re-generate those site page JSON object and assign the template IDs to the correct values. What is incorrect about them? Are a bunch of entries assigned to the wrong template? If that is the case then you should update the template_id in the exp_publisher_titles table, then re-save an entry and it’ll update the site pages JSON object. If you do any sort of manual updates like this I don’t think I can provide additional support unless you can demonstrate an incorrect assignment of IDs was clearly a Publisher related bug. Manually editing records like this can throw things out of whack if you don’t do it correctly to a point where I can’t assist anymore. I’d just have to ask you to revert to a previous version of the database.

#35

James Brown

Hi Brian- Sorry for the delay in responding back to you. On your last response, there’s actually nothing left to do on that one. I was mistakenly thinking that ALL entries in the channel had the wrong template. But it was just the subsequent saves that were getting the wrong template id. So nothing left to solve there.

On the other 2 items I ended up uninstalling Publisher and reinstalling. That seemed to resolve the issues I was having with #3 in my original issue.

I was trying to recreate the issue for #2 with deleting drafts. For whatever reason I can’t seem to delete drafts at all. I’ll create an entry and publish it. Then I’ll go back to the entry, save a draft, then click Delete Draft. The button changes to the “Deleting Drafts” version. The problem is it never changes nor does it actually delete the draft.

#36

BoldMinded (Brian)

Comment has been marked private.

#37

James Brown

Yikes! I got a fatal error in the control panel when I loaded that:

Fatal error: Cannot redeclare composerRequire7622a17e6675f8cdd33ef0a270cae2b0() (previously declared in /var/www/html/system/user/addons/publisher/vendor/composer/autoload_real.php:63) in /var/www/html/system/user/addons/*publisher/vendor/composer/autoload_real.php on line 70

#38

BoldMinded (Brian)

What other add-ons do you have installed? That doesn’t seem like a generic error, I’m not getting that in any environment, so its most likely something unique with yours.

#39

James Brown

I figured out the issue with updating. I had kept the old publisher directory as “*publisher” and then uploaded the new one. That way I could easily switch back if there were issues. I guess it didn’t like that. Deleting out the old directory made it run just fine.

But I’m still having the same issue where I click Delete Draft and the button changes to the in-progress version, but nothing ever gets deleted.

#40

BoldMinded (Brian)

Ah, yeah EE definitely does not like copies of add-on folders like that.

I’ll take another look at the draft deletion stuff, but the last build I sent should have definitely fixed it.

#41

James Brown

I was trying to be too smart about it!

#42

BoldMinded (Brian)

Comment has been marked private.

#43

James Brown

ok, updated to the version you sent but it’s still hanging on deleting the draft. I put a quick screen recording to show you what I’m seeing. http://anomali.com/files/Screen_Recording_2020-08-05_at_4.34.28_PM.mov

#44

BoldMinded (Brian)

That video doesn’t look like you’re deleting a draft.

#45

James Brown

Apologies. I grabbed the wrong file URL. It is: http://anomali.com/files/Screen_Recording_2020-08-24_at_10.23.12_AM.mov

#46

BoldMinded (Brian)

Based on the video I’m about 90% certain you just need to clear your browser cache. The new build included JS updates, which do not appear to be present.

#47

James Brown

Success!

This is more a question, after deleting the draft I leave the entry I’m editing and and taken to the list of entries page. Is that expected? Or should I stay in the entry edit page?

#48

BoldMinded (Brian)

Yeah, that is expected behavior, at least for now. I might change it to direct back to the open version.

#49

James Brown

ok, working as expected then!

Login to reply