Create a form field for tag type as below.
<field name="tags" type="tag" label="JTAG" description="JTAG_DESC" multiple="true" published="1"></field>
This will show unpublished tags as well.
It should show only tags with the published status 1
Shows all tags including unpublished
Reproducible in both Joomla 3 and Joomla 4
Root cause:
src/Form/Field/TagField.php line 130
$published = $this->element['published'] ?: array(0, 1);
This returns an object with the attribute name as 0
However, the value was checked for numeric and array types as shown below.
// Filter on the published state
if (is_numeric($published))
{
$published = (int) $published;
$query->where($db->quoteName('a.published') . ' = :published')
->bind(':published', $published, ParameterType::INTEGER);
}
elseif (\is_array($published))
{
$published = ArrayHelper::toInteger($published);
$query->whereIn($db->quoteName('a.published'), $published);
}
Labels |
Added:
?
|
Labels |
Added:
?
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-02-06 16:18:24 |
Closed_By | ⇒ | richard67 | |
Labels |
Added:
?
Removed: ? |
PR #32065