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.
PR #4261
Category | Libraries | ⇒ |
Title |
|
Title |
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2014-09-10 09:16:23 |
Labels |
Added:
?
|
With the new system you dont need to create an issue here if you are going to create a PR on github as the two systems are in sync. I am closing this in favour of #4261 so we only have one issue
This comment was created with the J!Tracker Application at http://issues.joomla.org/.