No Code Attached Yet
avatar PhocaCz
PhocaCz
27 Aug 2021

Steps to reproduce the issue

Click on batch button:
img

Expected result

No Javascript error

Actual result

Javascript error
img

System information (as much as possible)

Joomla 4 Stable, Windows, Linux

Additional comments

avatar PhocaCz PhocaCz - open - 27 Aug 2021
avatar joomla-cms-bot joomla-cms-bot - change - 27 Aug 2021
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 27 Aug 2021
avatar chmst
chmst - comment - 27 Aug 2021

Which Batch button? I cannot replicate this error in com_content, com_contact, com_odules. Can you give more information please?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35394.

avatar PhocaCz
PhocaCz - comment - 27 Aug 2021

Hi Christiane,

I get these problems in my extensions where it worked in RC/Beta versions but not more in Stable. Maybe, it seems like some problem when moving from BS4 to BS5. It occurs by batch buttons, where standard code:

HTMLHelper::_('bootstrap.renderModal', 'collapseModal'); ... $bar->appendButton('Custom', $dhtml, 'batch');

does not work anymore (throws this error). It looks like I need to find another solution.

Anyway, will be great to get some info about all the changes which happened between Beta and Stable, because a lot of code which was overwritten for Beta does not more work in Stable. :-(

Thank you, Jan

avatar joomdonation
joomdonation - comment - 27 Aug 2021

@PhocaCz In my extensions, I use the same code as in J3 and it still works https://github.com/joomla/joomla-cms/blob/3.10-dev/administrator/components/com_content/views/articles/view.html.php#L182-L188

If it is really needed, maybe you can attach a copy of your extension here and tell us where the code is used and have problem. Maybe someone could look at it and give you correct code to use (hope so :) )

avatar PhocaCz
PhocaCz - comment - 27 Aug 2021

@joomdonation Did you test it in stable? I use exactly the same code as you are using and it worked OK in beta/rc but in stable it throws now error. :idea:

img

img

Jan

avatar joomdonation
joomdonation - comment - 28 Aug 2021

@PhocaCz Yes. I tested it, the modal opens OK, so I did not check the console for that js error. Don't have time to check to see what's causing that error now but quick modification to use the following code solves the issue for me. Maybe you can try

$bar = JToolbar::getInstance('toolbar');
$bar->popupButton('batch')
	->text('JTOOLBAR_BATCH')
	->selector('collapseModal')
	->listCheck(true);
avatar PhocaCz PhocaCz - close - 29 Aug 2021
avatar PhocaCz
PhocaCz - comment - 29 Aug 2021

@joomdonation Yes, this did the trick, now the batch function works without any error and the produced output is OK (including BS5 attributes):

<joomla-toolbar-button id="toolbar-batch" list-selection="">
<button value="http://localhost/xxx/administrator/" class="button-batch btn btn-primary" type="button" data-bs-toggle="modal" data-bs-target="#collapseModal">
	<span class="icon-square" aria-hidden="true"></span>
	Batch</button>
</joomla-toolbar-button>

Thank you, Jan

avatar PhocaCz PhocaCz - change - 29 Aug 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-08-29 10:56:35
Closed_By PhocaCz
avatar Fedik
Fedik - comment - 29 Aug 2021

please test #35417

Add a Comment

Login with GitHub to post a comment