Forum
Textarea in repeater not saving
I have a template containing a repeater, with each item containing a heading and textarea.
On first creating a region using this template, only the textarea in the first item of the repeater is being saved. Text I've entered for the second textarea is not saved. If I then add the text again in the second textarea and save, this time it saves OK.
Diagnostic report:
Summary information
Perch: 2.8.14, PHP: 5.5.12, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: bf9ad53b11c9a57efdb1057292d73b928b8c5c77 $, with PDO
Server OS: WINNT, apache2handler
Installed apps: content (2.8.14), assets (2.8.14), categories (2.8.14), perch_forms (1.8.3)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_forms', ); ?>
PERCH_LOGINPATH: /cms
PERCH_PATH: C:\wamp\www\sp-test\cms
PERCH_CORE: C:\wamp\www\sp-test\cms\core
PERCH_RESFILEPATH: C:\wamp\www\sp-test\cms\resources
Image manipulation: GD
PHP limits: Max upload 64M, Max POST 3M, Memory: 128M, Total max file upload: 3M
Resource folder writeable: Yes
HTTP_HOST: sp-test.local
DOCUMENT_ROOT: C:/wamp/www/sp-test
REQUEST_URI: /cms/core/settings/diagnostics/
SCRIPT_NAME: /cms/core/settings/diagnostics/index.php
Template:
<div class="repeater_test"> <perch:repeater id="repeater_test" label="Test repeater" max="2"> <div class="test"> <perch:if exists="heading"> <h2> <perch:content type="text" id="heading" label="Heading" order="1" title="true" /> </h2> </perch:if> <perch:content type="textarea" id="text" label="Text" help="If copying text from any other programme like Word, from an email or from a web page, right-click and select 'Paste as plain text' (only available in some web browsers)." order="2" html="true" editor="redactor" imagewidth="960" imageheight="720" /> </div> </perch:repeater> </div>
Apologies - didn't format template code properly:
Template:
As a test, if you turn off Redactor for the textarea, does that change anything?
Yes - if I change from using Redactor to Markitup, both textareas save OK at the first attempt.
Ok, sounds like an issue relating to Redactor. We'll log it and see if we can track it down.
I don't know if this is related (I had the above problem previously), but redactor also doesn't seem to respect the size="xxx" on textareas either.
They seem to default to small, but then just expand to the size of the content added regardless.
Was there any solution to this? I'm finding the same issue and had client complaints about content in repeaters not saving.
A new version of Redactor was released shortly after this. Not sure if it addresses these issues though.
It looks like Redactor 11 is a major upgrade. It would be great to get the Perch plugin updated to use this version. I'd be very happy to test this issue again then.
Yes it still seems to be an issue that wasn't fixed. I've had to change the text editor in use just for repeater regions which is a bit of a shame as it is inconsistent with the rest of the site...
We've not had a chance to address this yet.
There is a new version of Redactor, but we're not convinced it's worth the $1495 we'd need to spend on it.
I only suggested the Redactor upgrade in the hope it might possibly provide a simple fix - I didn't realise the new version required you to buy a new OEM licence! And of course, there's no guarantee that upgrading Redactor will actually fix this issue.
It's clear that a few other users are also experiencing the issue. I'm hoping that you can continue to investigate it. Redactor is supposed to be capable of handling more than one textarea on the same page.
It's reproduced and logged. The issue is initialising the cloned instance when dynamically generating a new repeater item. Nothing really to do with having multiple instances on a page - as is clear once you save the edit.
I just need time to look at it, and I haven't had a chance yet.
Switched to TinyMCE to try to avoid this issue, but it seems that image upload is not available in TinyMCE.