Problems with Status
Posted: 16 October 2007 07:30 PM   [ Ignore ]
Newbie
Rank
Total Posts:  20
Joined  2005-11-10

Hi. I posted this in the EE plugin discussion forum, but it was suggested that I might find more help here.

I’m trying to use the Form Helper plugin to create a stand alone edit form for my clients who own this site. I have been able to get the basic form working fairly easily, but I’m running into problems with the exp:form_helper:statuses tag.

Here’s the code I’m using:

{exp:weblog:entries weblog="newsletters" show_expired="yes" rdf="off"}
{exp
:weblog:entry_form weblog="newsletters"}

<input type="hidden" name="entry_id" value="{entry_id}" />

{exp:form_helper:statuses entry_id="{entry_id}"}
<input type="radio" name="status" value="{entry_status}" {checked} /> {entry_status}
{
/exp:form_helper:statuses}

<p><strong>Title</strong><br />
<
input type="text" name="title" value="{title}" class="saeftextfield" maxlength="100" /></p>

<
p><strong>Image For The Article</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
(
applies only to main weblog, newsletters and testbed; image should be 500 pixels wide by 100 pixels high)<br />
<
textarea name="{exp:form_helper:field_grabber field_name='entryimage'}"  rows="10" class="saeftextarea2" />{exp:form_helper:field_parser}{entryimage}{/exp:form_helper:field_parser}</textarea>
<
input type="hidden" name="{exp:form_helper:field_grabber field_name='body' which='format'}" value="br" /></p>

<
p><strong>Body</strong><br />
<
textarea name="{exp:form_helper:field_grabber field_name='body'}"  rows="10" class="saeftextarea" />{exp:form_helper:field_parser}{body}{/exp:form_helper:field_parser}</textarea>
<
input type="hidden" name="{exp:form_helper:field_grabber field_name='body' which='format'}" value="br" /></p>

<
p><strong>Extended Text</strong><br />
<
textarea name="{exp:form_helper:field_grabber field_name='extended'}"  rows="10" class="saeftextarea" />{exp:form_helper:field_parser}{extended}{/exp:form_helper:field_parser}</textarea>
<
input type="hidden" name="{exp:form_helper:field_grabber field_name='extended' which='format'}" value="br" /></p>

<
input type="submit" name="submit" value="Submit" />

{/exp:weblog:entry_form}
{
/exp:weblog:entries}

The problem is that the status checkboxes don’t show up at all on the form.

If I use the standard status drop-down menu from an EE stand alone _entry_ form:

{status_menu}
<p>Status<br />
<
select name="status">
{select_options}
</select>
</
p>
{/status_menu}

I can get the drop-down menu to show up on the form, and I can close an entry from that form. However, if I go back to the same url (basedomainname/index.php/templategroup/saef/entryid) to see if I can open the entry again, I just get white space where the form should be.

My ultimate objective is to enable the client to use a stand alone edit form to close an entry and to open it back up again, but I would sacrifice the “open it back up again” if necessary.

Thanks in advance for any help anyone can offer - I really appreciate it. Let me know if you need more information or further explanation.

Frank

Profile
 
 
Posted: 15 August 2008 11:25 AM   [ Ignore ]   [ # 1 ]
Newbie
Rank
Total Posts:  13
Joined  2006-09-13

I’m actually experiencing this same issue.  Can anyone give an explanation to this issue?

Basically, to sum it up, I cannot get the form helper status to work.

{exp:form_helper:statuses entry_id="{entry_id}" exclude="open|closed|hamsandwich"}
<input type="radio" name="status" value="{entry_status}" {checked} /> {entry_status}
{
/exp:form_helper:statuses}

I only have an open and closed status.  If I don’t include the exclude parameter, nothing shows up at all.  If I do include it, the input shows up, but there are no statuses listed.  It appears to me, {entry_status} variable isn’t being rendered in the value parameter or as the title for the input field.  I’ve tried this with a select dropdown as well and it doesn’t work.

Has anyone else experienced issues when using the statuses form helper?

Profile
 
 
Posted: 15 August 2008 11:31 AM   [ Ignore ]   [ # 2 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3343
Joined  2006-10-18

Frank/Sts,

You’re both forgetting the <select> parts of the form field. wink

It should look like this:

<select name="status">
{exp:form_helper:statuses entry_id="{entry_id}"}
<option value='{entry_status}' {checked}>{entry_status}</option>
{/exp:form_helper:statuses}
</select>

 Signature 
Profile
 
 
Posted: 15 August 2008 11:38 AM   [ Ignore ]   [ # 3 ]
Newbie
Rank
Total Posts:  13
Joined  2006-09-13

Thanks for the quick reply pieman…

Actually, I didn’t put that portion in my post although I’ve tried that.  What I pasted was an input, not a select.  Here is where I currently am with my struggles.

<p>
<
label>Status:</label>     
<
select name="status">
  
{exp:form_helper:statuses entry_id="{entry_id}" exclude="open|closed"}
  
<option value='{entry_status}' {selected}>{entry_status}</option>
  
{/exp:form_helper:statuses}
</select>
</
p>

...and that is rendering out as:

<p>
<
label>Status:</label>     
  <
select name="status">
   <
option value='' ></option>
  </
select>
</
p>

...if I eliminate the “exclude” parameter which makes sense to me from the plugin docs, the following:

<p>
<
label>Status:</label>     
<
select name="status">
  
{exp:form_helper:statuses entry_id="{entry_id}"}
  
<option value='{entry_status}' {selected}>{entry_status}</option>
  
{/exp:form_helper:statuses}
</select>
</
p>

...renders to this:

<p>
<
label>Status:</label>     
<
select name="status">     
</
select>
</
p>

Profile
 
 
Posted: 15 August 2008 11:46 AM   [ Ignore ]   [ # 4 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3343
Joined  2006-10-18

Just out of curiousity, what happens when you do this:

<p>
<
label>Status:</label>  
<
select name="status">
  
{exp:form_helper:statuses entry_id="{entry_id}" exclude="closed"}
  
<option value='{entry_status}' {selected}>{entry_status}</option>
  
{/exp:form_helper:statuses}
</select>
</
p>

Or this: ({checked} instead of {selected} - I thought I remember there being an issue with {selected})

<p>
<
label>Status:</label>  
<
select name="status">
  
{exp:form_helper:statuses entry_id="{entry_id}" exclude="closed"}
  
<option value='{entry_status}' {checked}>{entry_status}</option>
  
{/exp:form_helper:statuses}
</select>
</
p>

 Signature 
Profile
 
 
Posted: 15 August 2008 11:55 AM   [ Ignore ]   [ # 5 ]
Newbie
Rank
Total Posts:  13
Joined  2006-09-13

They actually both render the same:

<p>
<
label>Status:</label>  
<
select name="status">
  <
option value=' ' ></option>
</
select>
</
p>

hmm.

Profile
 
 
Posted: 15 August 2008 11:56 AM   [ Ignore ]   [ # 6 ]
Newbie
Rank
Total Posts:  13
Joined  2006-09-13

It’s basically ignoring {entry_status}.  I re-downloaded the plugin and installed it, just to make sure I had the latest build of it, and it’s the same result.

Profile
 
 
Posted: 15 August 2008 12:00 PM   [ Ignore ]   [ # 7 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3343
Joined  2006-10-18

Well, for the time-being, is it ok if you hardcode the form? smile

<select name="status">
<
option value="open" {if status == "open"}selected="selected"{/if}>Open</option>
<
option value="closed" {if status == "closed"}selected="selected"{/if}>Closed</option>
</
select>

The conditionals will “remember” which is currently selected wink

 Signature 
Profile
 
 
Posted: 15 August 2008 12:06 PM   [ Ignore ]   [ # 8 ]
Newbie
Rank
Total Posts:  13
Joined  2006-09-13

Actually, that is exactly what I just implemented and it’s working well.  Of course, I would like to set it and forget it, but this will work for now.  Thanks so much!

sts

Profile
 
 
Posted: 15 August 2008 12:22 PM   [ Ignore ]   [ # 9 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3343
Joined  2006-10-18

Strange though… I have it working on my site....

 Signature 
Profile
 
 
Posted: 15 August 2008 12:27 PM   [ Ignore ]   [ # 10 ]
Newbie
Rank
Total Posts:  13
Joined  2006-09-13

yeah, something must be up on my site because it doesn’t work with status or pulldowns, but categories work like a charm.  I’m using a url_title="{segment_3" and limit="1" parameters.  Would that cause any ill effect?

Profile
 
 
Posted: 15 August 2008 12:47 PM   [ Ignore ]   [ # 11 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3343
Joined  2006-10-18
sts - 15 August 2008 12:27 PM

I’m using a url_title="{segment_3" and limit="1" parameters.  Would that cause any ill effect?

Hmmmm… even if that was somehow the issue, Categories seems to work though…

Are you able to post your full code? smile

 Signature 
Profile
 
 
Posted: 15 August 2008 12:51 PM   [ Ignore ]   [ # 12 ]
Newbie
Rank
Total Posts:  13
Joined  2006-09-13

Following is all of my code for the edit form.  I actually had an error in the custom field pulldown problem that I mentioned.  I had a typo in my custom field variable.  The status is still the issue and right now, I have it being set conditionally with pure Expression Engine.  If you see anything for me to try, I’ll give it a shot:)

{if segment_2 == "edit_form" AND segment_3 != "submitted"}  

  {exp
:weblog:entries weblog="as_materials" status="open|closed" url_title="{segment_3}" limit="1"}

    
<div id="c1">
     <
img src="/images/uploads/ad_support/previews/{title}.jpg" width="450" height="450" />
    </
div><!--/c1-->

    <
div id="c2">

     
{exp:weblog:entry_form weblog="as_materials" return="ad_support/edit_form/submitted"}
     
<input type="hidden" name="entry_id" value="{entry_id}" />
     <
input type="hidden" name="title" value="{title}" />
     <
input type="hidden" name="entry_date" value="{entry_date format='%Y-%m-%d %g:%i %A'}" />
     <
input type="hidden" name="category[]" value="{cat_id}" />
     <
input type="hidden" name="url_title" id='url_title' value="{url_title}" />
     
     <
p>
      <
label>Title:</label>
      <
input class="input" type="text" name="title" id="title" value="{title}" size="50" maxlength="100" onkeyup="liveUrlTitle();" />
     </
p>
     
     <
p>
     <
label>File type:</label>
     <
select name="{exp:form_helper:field_grabber field_name='as_filetype'}">
     
{exp:form_helper:custom_pulldown entry_id="{entry_id}" field_name="as_filetype"}
     
<option value="{value}" {selected}>{value}</option>
     
{/exp:form_helper:custom_pulldown}
     
</select>
     <
input type="hidden" name="{exp:form_helper:field_grabber field_name='as_filetype' which='format'}" value="br" />
     </
p>
     
     <
p>
     <
label>Description:</label>     
     <
textarea class="textarea" name="{exp:form_helper:field_grabber field_name="as_description"}" cols="10" rows="4">{as_description}</textarea>
     </
p>

     <
p>
     <
label>Categories:</label>
     <
select class="multiple" name="category[]" size="5" multiple="multiple">
      
{exp:form_helper:categories entry_id="{entry_id}"}
      
<option value="{cat_id}" {selected}>{cat_name}</option>
      
{/exp:form_helper:categories}
     
</select>
     </
p>
      
     <
p>
     <
label>Status:</label>     
     <
select name="status">
      <
option value='open' {if status == "open"}selected{/if}>open</option>
      <
option value='closed' {if status == "closed"}selected{/if}>closed</option>
     </
select>
     </
p>
          
     <
div id="submit_area">
      <
input class="submit" type="submit" name="submit" id="submit" value="Submit" />
     <
div class="clear"></div><!--/clear-->
     </
div><!--/submit_area-->
    
{/exp:weblog:entry_form}
  {
/exp:weblog:entries}   

    
<br class="clear" />
    </
div><!--/c2-->

{if:elseif segment_2 == "edit_form" AND segment_3 == "submitted"}
    
<div id="submitted">
     <
h1>Submitted!</h1>
    </
div>
{/if}

Profile
 
 
Posted: 19 August 2008 06:33 AM   [ Ignore ]   [ # 13 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3343
Joined  2006-10-18

Just for the record, you shouldn’t need to use url_title="{segment_3}” as it will automatically detect the Entry ID from the URL smile

 Signature 
Profile