Page 1 of 1

CGBlog Category Numbers Instead Of Names In FEU Form Area

Posted: Wed Oct 01, 2014 1:38 pm
by govicinity
CMS Made Simple™ 1.11.10 “Pinzon”
CGExtensions 1.42.2
FrontEndUsers 1.24.1
CGSmartImage 1.17
JQueryTools 1.2.6
CGSmartImage 1.17
CGBlog 1.12.6

Hi all, having an issue with CGBlog and my Frontend Article Submission Form Templates.

My template can be seen as an image here Image
You can see my categories are being listed as numbers instead of their names, very odd, it was working before update of CGBlog today, but just updated it to version 1.12.6

Any help appreciated.

Re: CGBlog Category Numbers Instead Of Names In FEU Form Are

Posted: Fri Oct 03, 2014 11:03 am
by govicinity
No takers for this one?

I also forgot to mention that all of the checkboxes for the categories seem to be checked whereas none of them should be checked at all to start with, so that's interesting (well it is to me), so I need to make sure they are not checked by default, and do not have numbers as their names, but actually have the category names instead.

Re: CGBlog Category Numbers Instead Of Names In FEU Form Are

Posted: Fri Oct 03, 2014 11:30 am
by stetman
I've got exactly the same problem. Already posted it on the forum without any luck so far.
I think the problem is the use of {$name} in the foreach, but don't know the solution.

Hope somebody does

Re: CGBlog Category Numbers Instead Of Names In FEU Form Are

Posted: Fri Oct 03, 2014 11:35 am
by Jo Morg
Better than posting an image of the template would be posting the image and the template code. ;)

Re: CGBlog Category Numbers Instead Of Names In FEU Form Are

Posted: Fri Oct 03, 2014 11:54 am
by govicinity
Here's the FEU Form code, pretty much the standard template:

Code: Select all

{* original form template *}
<__script__ type="text/javascript">
{literal}
function toggle_dates()
{
  var elem = document.getElementById('use_expiry');
  if( elem.checked == true )
  {
    document.getElementById('datefields').style.display = 'block';
  }
  else
  {
    document.getElementById('datefields').style.display = 'none';
  }
}
{/literal}
</__script>

{if isset($error)}
  <h3><font color="red">{$error}</font></h3>
{else}
  {if isset($message)}
    <h3>{$message}</h3>
    <p>{$return_link}</p>
  {/if}
{/if}
{if !isset($message)}
<p>List your items for sale here by filling in the details below, be as descriptive as possible. Please note your telephone number and email address will show on the site if you input these.</p>
{$startform}
	<div class="pageoverflow">
		<p class="pagetext">*{$titletext}:</p>
		<p class="pageinput">{$inputtitle}</p>
	</div>
	<div class="pageoverflow">
		<p class="pagetext">{$categorytext}:</p>
		<p class="pageinput">
                  {foreach from=$categorylist item='tmp' key='name'}
                    <input type="checkbox" name="{$actionid}cgblog_category_id[]" value="{$tmp.id}" {if $tmp.selected}checked="checked"{/if}>&nbsp;{$name}<br/>
                  {/foreach}
                </p>
	</div>
{if !isset($hide_summary_field) or $hide_summary_field == 0}
	<div class="pageoverflow">
		<p class="pagetext">{$summarytext}:</p>
		<p class="pageinput">{$inputsummary}</p>
	</div>
{/if}
{if isset($input_status)}
        <div class="pageoverflow">
		<p class="pagetext">{$prompt_status}:</p>
		<p class="pageinput">{$input_status}</p>
        </div>
{/if}
	<div class="pageoverflow">
		<p class="pagetext">*{$contenttext}:</p>
		<p class="pageinput">{$inputcontent}</p>
	</div>

        {if $fesubmit_useexpiry}
	<div class="pageoverflow">
		<p class="pagetext">{$CGBlog->Lang('useexpiration')}:</p>
		<p class="pageinput">
                  <input type="hidden" name="{$actionid}cgblog_usexpiry" value="0"/>
	          <input type="checkbox" id="use_expiry" name="{$actionid}cgblog_usexpiry" value="1" {if $use_expiry == 1}checked="checked"{/if} onclick="toggle_dates();"/>
                </p>
	</div>
        <div id="datefields" {if $use_expiry == 0}style="display: none;"{/if}>
	<div class="pageoverflow">
		<p class="pagetext">{$startdatetext}:</p>
		<p class="pageinput">{html_select_date prefix=$startdateprefix time=$startdate start_year='-10' end_year="+15"} {html_select_time prefix=$startdateprefix time=$startdate}</p>
	</div>
	<div class="pageoverflow">
		<p class="pagetext">{$enddatetext}:</p>
		<p class="pageinput">{html_select_date prefix=$enddateprefix time=$enddate start_year='-10' end_year="+15"} {html_select_time prefix=$enddateprefix time=$enddate}</p>
	</div>
        </div>
        {/if}

	{if isset($customfields)}
	   {foreach from=$customfields item='onefield'}
	      <div class="pageoverflow">
		<p class="pagetext">{$onefield->name}:</p>
		<p class="pageinput">{$onefield->field}</p>
	      </div>
	   {/foreach}
	{/if}
	<div class="pageoverflow">
		<p class="pagetext">&nbsp;</p>
		<p class="pageinput">{$hidden}{$submit}{$cancel}</p>
	</div>
{$endform}
{/if}

Re: CGBlog Category Numbers Instead Of Names In FEU Form Are

Posted: Fri Oct 03, 2014 12:07 pm
by Jo Morg
govicinity wrote:You can see my categories are being listed as numbers instead of their names, very odd, it was working before update of CGBlog today, but just updated it to version 1.12.6
govicinity wrote:(...)pretty much the standard template(...)
Yep, so it seems.
Clear CMSMS cache just in case, but it seems it's a bug.
If confirmed, I advise filing a bug report on http://dev.cmsmadesimple.org/bug/list/649, with as much detail as possible so that the developer can reproduce it, and fix it.

Re: CGBlog Category Numbers Instead Of Names In FEU Form Are

Posted: Fri Oct 03, 2014 12:35 pm
by govicinity
@Jo, thanks for looking and registering the bug, I'll see if I can roll it back this end from an old backup of the site for now and await an update. Cheers again.

Re: CGBlog Category Numbers Instead Of Names In FEU Form Are

Posted: Sat Oct 04, 2014 9:23 am
by stetman
@govicinity, correct me if I'm wrong, but I don't think Jo registered the bug. So I did, because I'm having the same problem.
Any luck with previous version ?

Re: CGBlog Category Numbers Instead Of Names In FEU Form Are

Posted: Sat Oct 04, 2014 7:50 pm
by stetman
Ok, time for an update. Calguy responded to my bug report that he tested the module and it worked. So I did a clean install and it did work with me too. I couldn't reproduce the problem.
I then did a sql export of all the cgblog tables and uninstalled the cgblog module. Then installed it again and imported the exported data and tadaaa....problem solved.

Don't forget to save your templates (as I did).
Hope this information is of any help.

Re: CGBlog Category Numbers Instead Of Names In FEU Form Are

Posted: Mon Oct 06, 2014 2:19 pm
by govicinity
OK, I have uninstalled CGBlog on the website in question, and then re-installed it - categories work well with the new Sample template, but please note I have noticed that the most up-to-date Sample template is quite different from the previous one, so if you have saved your own altered templates, DO NOT paste them in as is, you may need to set up a new version of your own template by stripping in code from your own template to a new Sample template... I hope this makes sense!

When I just took my old template and pasted it in (which was a barely altered version of the old Sample template) I reproduced the error with the categories being numbered. I did also see a literal tag in one of the old Sample templates within the <__script__> tags themselves rather than outside them, although this had no bearing on the error itself.

I have also noticed a rogue <em> at the end of the li items just before the rec_count in the browse category templates, may be an idea to remove this or close the tag.

Oddly I now have another issue whereas the actual blog articles are not showing! Although the categories list states that there are articles within the categories!

[SOLVED] CGBlog Category Numbers Instead Of Names In FEU For

Posted: Mon Oct 06, 2014 3:03 pm
by govicinity
OK, despite clearing cache, updating page hierarchy, updating routes, optimising tables and repairing tables nothing seemed to work... thankfully now it seems to have corrected itself and is working, so looks like this thread is a solved issue. Thanks to everyone who had input.