No Code Attached Yet
avatar mastervanleeuwen
mastervanleeuwen
24 Oct 2021

Steps to reproduce the issue

Use JHtml::_('grid.published', $obj, $i)

Expected result

code for an icon with javascript to publish/unpublish an item

e.g. in Joomla 3:
<a href="#" onclick="return listItemTask('cb0','unpublish')" title="Unpublish Item"><img src="/administrator/templates/isis/images/admin/tick.png" alt="Published" /></a>

Actual result

<a href="#" onclick="return Joomla.listItemTask('cb0','unpublish')" title="Unpublish Item"><img src="" alt="Published" ></a>
The img src field is empty. There is no admin directory in templates/cassiopeia/imagies/. Does cassiopeia use a symbol font for the published icon?

System information (as much as possible)

Additional comments

I am migrating code from Joomla 3 to Joomla 4; this call seems to be intended to work, but something is missing. Maybe the names of the icon files changed?

avatar mastervanleeuwen mastervanleeuwen - open - 24 Oct 2021
avatar mastervanleeuwen mastervanleeuwen - change - 24 Oct 2021
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 24 Oct 2021
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 24 Oct 2021
avatar joomdonation
joomdonation - comment - 25 Oct 2021

@mastervanleeuwen Better migrate your code to use jgrid.published instead. Your old code could be changed to :

JHtml::_('jgrid.published', $row->published, $i);

Or better, using namespace code:

HTMLHelper::_('jgrid.published', $row->published, $i);

That's how I did while migrating my extensions to Joomla 4.

avatar mastervanleeuwen
mastervanleeuwen - comment - 26 Oct 2021

Thanks for the tip; this works. I wonder what
JHtml::_('grid.published')
is meant for, but this solved my problem!

avatar mastervanleeuwen mastervanleeuwen - change - 26 Oct 2021
The description was changed
avatar mastervanleeuwen mastervanleeuwen - edited - 26 Oct 2021
avatar mastervanleeuwen mastervanleeuwen - change - 26 Oct 2021
Title
[4.0] JHtml::_('grid.published') does pick up tick.png icon
[4.0] JHtml::_('grid.published') does not pick up tick.png icon
avatar mastervanleeuwen mastervanleeuwen - edited - 26 Oct 2021
avatar chmst
chmst - comment - 27 Oct 2021

@mastervanleeuwen thanks for feedback! Could you close the issue, please?

avatar mastervanleeuwen mastervanleeuwen - change - 27 Oct 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-10-27 12:00:12
Closed_By mastervanleeuwen
avatar mastervanleeuwen mastervanleeuwen - close - 27 Oct 2021
avatar mastervanleeuwen
mastervanleeuwen - comment - 27 Oct 2021

Sorry for insisting, but this still leaves the question open why the grid.published function
has 'tick.png' and 'publish_x.png' as default arguments; it looks like the code cannot find these files; is that intentional?

avatar chmst
chmst - comment - 27 Oct 2021

Yes, J4 uses icons

image

Add a Comment

Login with GitHub to post a comment