User tests: Successful: Unsuccessful:
This is not only an issue of form field type "tag" but also for any multiple form field with class that
extends JFormFieldList
1) In an article add 2 or 3 tags. Save article. Close it.
2) In
/components/com_content/views/article/tmpl/edit.php
after
defined('_JEXEC') or die;
add line
$this->form->setFieldAttribute('tags', 'readonly', 'true');
OR(!)
add a readonly attribute to field definition of "tags" in
/components/com_content/models/forms/article.xml
field name="tags"
type="tag"
label="JTAG"
description="JTAG_DESC"
class="span12"
multiple="true"
readonly="true"
3) Set error reporting in Joomla configuration to maximum.
4) Reopen article of step 1).
5) You'll see a PHP warning
htmlspecialchars() expects parameter 1 to be string, array given in /libraries/joomla/form/fields/list.php on line 66
6) In disabled tags field you'll see your tags.
7) Save article.
Tags field is now empty and tag assignments to this article are removed from database
In /libraries/joomla/form/fields/list.php if readonly is active for a select box a hidden field is created that throws above warning/error because form field e.g. of type tag (extends JFormFieldList) sends $this->value as an array not as a single value.
Labels |
Added:
?
|
Code style:
please add an empty line before the foreach.
Test by guost has no value. User is deleted.
@test thanks @illovo i can confirm the issue and your fix work good for me.
This comment was created with the J!Tracker Application at http://issues.joomla.org/.
Category | ⇒ | Administration Tags |
Easy | No | ⇒ | Yes |
@test ok thanks for contributing!
This comment was created with the J!Tracker Application at http://issues.joomla.org/.
thanks @b2z moving to RTC
This comment was created with the J!Tracker Application at http://issues.joomla.org/.
Status | Pending | ⇒ | Ready to Commit |
Labels |
Added:
?
|
Status | Ready to Commit | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-10-08 08:02:19 |
Labels |
Removed:
?
|
@test
Successfully tested with test instructions and 2 own components.