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: Display entry that has been submitted as draft, but has not been published yet

Status Resolved
Add-on / Version Publisher Lite 1.6.2
Severity
EE Version 2.9.2

Ryan John

Mar 18, 2015

Description: I have a site where people can register and submit an entry through channel:form, where it stays as draft until it’s been approved and published to show on the front-end of the site. This works fine, but in their main area of their profile, I need to list their submitted entries. I cannot figure out how to list the projects that have not been published yet. My goal is to have entry titles show and if published there is a link to edit, if awaiting approval it shows the title but says pending and they cannot access it. I’ve tried status=“open|draft” status=“open{publisher:entry_status}” status=“open|{publisher:entry_status}” but they will not show. I put the publisher fields there to just echo out but they don’t show anything. I have an if no_results check, and if status=“open” it’s no results, but if one of the above status combo’s it doesn’t hit no_results, but nothing shows as if they entire entry loop gets ignored. Below is my loop:

1

 {has_newer_draft}
 {is_translation_complete}
 {has_translation}
 {has_pending_approval}
 {publisher_lang_id}
 {publisher_status}

  <h3 class="header">Production Name</h3>
<p>  </p><h3 class="project"><span>pending</span></h3>


How can I display these draft entries? If necessary I will give you access to the dev site but want to see what your initial thoughts are. I have another issue with matrix fields duplicating themselves on updating an entry but will create a separate ticket for that after this is resolved.

Thanks.

 

 

#1

BoldMinded (Brian)

Hi, Ryan. Thanks for the detailed report. Did you print {publisher:entry_status} to the page just to see what its value is? Also, do you have the Persistent Entries setting turned off or on?

#2

Ryan John

Yes printing the status still nothing, but I had the Persistent Entries setting turned off. I just set it to Yes and the entries are showing now so I think that should solve that issue.

The second issue that happens every time is like so:

Put entry from front end - only a draft exists Publish entry from back end - now there is a published/open status Go to edit it from front end - now it’s open and has a newer draft version - all good Go in to the newest draft, and all the matrix fields have duplicated every row. As well, the channel images field is now missing the image

Any ideas here?

#3

BoldMinded (Brian)

Ryan, if you need to have persistence turned off, you can try adding publisher_lang_id=”x” and publisher_status=”x” to your entries tag.

I’m unable to replicate the duplicate Matrix rows issue. I followed your steps several times and it seems to work each time. For reference this is my test form.

{exp:channel:form channel="pages" return="forms/channel-edit/ENTRY_ID" entry_id="{segment_3}"
    publisher_status="draft"
    include_jquery="yes"
    include_assets="yes"
    error_handling="inline"
    use_live_url="yes"
    datepicker="no"}

{field_errors}{error}{/field_errors}

    <input name="lang_id" value="{publisher:current_language_id}" type="hidden">
    <input name="publisher_view_status" value="draft" type="hidden">
    <input name="publisher_save_status" value="draft" type="hidden">

    <label for="title">Title</label>
    <input type="text" name="title" id="title" value="{title}" size="50" maxlength="100" >

    <label for="url_title">URL Title</label>
    <input type="text" name="url_title" id="url_title" value="{url_title}" maxlength="75" size="50">

    <label for="entry_date">Date</label>
    <input type="text" name="entry_date" id="entry_date" value="{entry_date}" maxlength="23" size="25">

    <label for="expiration_date">Expiration Date</label>
    <input type="text" name="expiration_date" id="expiration_date" value="{expiration_date}" maxlength="23" size="25">

    <label for="comment_expiration_date">Comment Expiration Date</label>
    <input type="text" name="comment_expiration_date" id="comment_expiration_date" value="{comment_expiration_date}" maxlength="23" size="25">

    <label class="checkbox"><input type="checkbox" name="sticky" value="y"  {sticky}> Make Entry Sticky</label>
    <label class="checkbox"><input type="checkbox" name="allow_comments" value="y" {allow_comments}> Allow Comments</label>

    {category_menu}
        <label for="categories">Categories</label>
        <select name="category[]" id="categories" size="4" multiple="multiple">
                {select_options}
        </select>
    {/category_menu}

    <input type="text" name="my_field_name" id="my_field_name" value="{page_body}">

    {field:page_body}

    {field:page_matrix}

    {if captcha}
        <label for="captcha">Please enter the word you see in the image below:</label>
        {captcha}
        <input type="text" name="captcha" value="{captcha_word}" maxlength="20">
    {/if}

    <input type="submit" name="submit" value="Submit">
{/exp:channel:form}
#4

Ryan John

Can I provide you with CP/FTP information you can see the issue yourself? If you can’t replicate then it must be something small and maybe you can find it pretty swiftly.

If I edit the ticket with the info, will that info only be viewable by yourself? I assume so but just checking.

#5

BoldMinded (Brian)

If you edit the ticket and use the provided fields for FTP info, only I can see it, and it will get deleted when the ticket is resolved.

I would prefer you replicate this on a clean environment with only Publisher installed first and provide access to that environment instead of the full site. I’ve logged into full sites before and gone down rabbit holes for hours trying to debug.

#6

BoldMinded (Brian)

Obviously in this case Publisher and Matrix needs to be installed, nothing else. Create 1 channel and 1 template needed to re-create the issue.

#7

Ryan John

I can only replicate the issue on the full site. I’ve edited the ticket with the info you need.

In the links in the top right there is a Submit a Production link or My Account if you’re already logged in. Follow there to submit a production and see what happens.

You are a super admin so if using that account you’ll probably see a bunch of php errors, so you can register with a new regular member account to see from that perspective. All those errors seem to be fine as far as the functionality goes, but the duplicate issue outlined previously in this ticket is the one that needs resolving.

Thanks

#8

BoldMinded (Brian)

Well, it concerns me that there are errors on the page. What are those error messages? I wont be able to login for several hours or may not until tomorrow, so if you can share those errors before hand it may help.

Did you simplify the site at least? E.g. remove all other add-ons except Publisher and Matrix? Remove everything from the template except for the form? What template files are used to render the form (group and name please).

#9

Ryan John

The error messages only show if submitting a project as Super Admin. As regular member they are suppressed and it goes to the thank you page as it should.

Here are the errors:

A PHP Error was encountered

Severity: Notice

Message: Undefined property: EE::$api_channel_entries

Filename: publisher/ext.publisher.php

Line Number: 353

A PHP Error was encountered

Severity: Notice

Message: Trying to get property of non-object

Filename: publisher/ext.publisher.php

Line Number: 353

The site is not simplified because the form requires several fields in order to submit. I don’t want to spend hours simplifying the site because it may be something simple you find right away. This also allows you to strip away anything problematic at your will.

The template is members/.add-project-en

#10

BoldMinded (Brian)

Emailed a new build that should fix that error.

#11

Ryan John

That did indeed solve the php errors, but the duplicate issue remains

#12

BoldMinded (Brian)

can you tell me which template is used to render the form?

#13

Ryan John

The template is members/.add-project-en

#14

BoldMinded (Brian)

Ryan, I took a look and created a test entry “Brian Test” and it didn’t duplicate any Matrix rows. Can you create a video of the process you’re taking to create the issue?

#15

Ryan John

Once you submit the entry, you need to go into the back end and publish it.

Then on the front-end, go back and edit it again. You don’t even need to make any changes just re-save it and you’ll see the duplication then.

If you go to the back end and publish it again, then edit, it will duplicate again. Each subsequent publish->edit->save duplicates all fields. The only time it doesn’t duplicate is the initial entry submission

#16

Brian Litzinger

I did go to the backend, viewed the entry by its default status of open, and there was no data b/c it was saved on the front as draft. Changed it to view draft, then saved it as Published.

#17

Ryan John

Did you then go back and edit it on the front end and re-save?

#18

Brian Litzinger

No, thought I did. I can see the duplicate rows now. BTW, the front-end login form does not work with the login you provided me.

#19

Brian Litzinger

I updated your template to include the status in the tag:

{exp:channel:form channel="projects"
     publisher_status="draft"

I resaved from the front-end and it did not seem to duplicate on the backend. Can you do some more testing with that?

#20

Ryan John

That seems to have helped. My only other concern is looking at your test entry there is no image. Did you make that not required when submitting your entry? Just because I noticed once or twice before that it would lose the image sometimes.

#21

Brian Litzinger

I never tested an image or most of the fields at the bottom of the form.

#22

Ryan John

Ok so just to be clear, you removed the required parameters on the channel:form tag when you were testing?

#23

Brian Litzinger

Nope, didn’t remove anything, just added that status parameter a few minutes ago.

#24

Ryan John

Ok this seems to be good now. I will test more today and if nothing arises I will mark as resolved. Thanks for your help

Login to reply