?
avatar bayareajenn
bayareajenn
23 Nov 2020

Steps to reproduce the issue

Install Joomla 3.9.23 with PHP 8 (64 bit but it doesn't matter)
Add some Categories, Articles, and Menu Items.
Use Batch in any of these to copy or move them.

Expected result

That one can copy or move items to other Menus, Article Categories, etc.

Actual result

The Move or Copy option/drop-down is missing from the Batch box.

System information (as much as possible)

Joomla 3.9.23
PHP 8.0.0RC5 (It's Harald's server)

Additional comments

Here's what it looks like missing said option.
articles-batch-rc2-2020-11-23_12-30-56
batch-php8-3 9 23ga-2020-11-23_11-25-21

avatar bayareajenn bayareajenn - open - 23 Nov 2020
avatar joomla-cms-bot joomla-cms-bot - change - 23 Nov 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 23 Nov 2020
avatar bayareajenn bayareajenn - change - 23 Nov 2020
The description was changed
avatar bayareajenn bayareajenn - edited - 23 Nov 2020
avatar HLeithner
HLeithner - comment - 23 Nov 2020

The reason for this is the new string to number comparison in PHP 8 RFC.

Since we use a non type safe comparison in administrator/components/com_content/views/articles/tmpl/default_batch_body.php:27

<?php if ($published >= 0) : ?>

This evaluates to true in php < 8 and to flase in php >= 8

So we should check the source for all non type safe comparisions and change them... at least in Joomla 4 we changed a lot.

For j3 I would suggest to fix the batch templates and fix reported bugs except someone want's to take the challange to check the codebase for non type safe comparisions.

avatar HLeithner
HLeithner - comment - 23 Nov 2020

Btw. as workaround for php8 it's possible to set the publish filter to "unpublished", "published" or "archived"

avatar b2z
b2z - comment - 29 Nov 2020

@HLeithner so in this case $published is not numeric?

avatar HLeithner
HLeithner - comment - 29 Nov 2020

yes because it empty '' a fix is easy just cast $published to int if you can create a PR I would be happy to merge it.

avatar alikon
alikon - comment - 30 Nov 2020

please test #31536

avatar alikon alikon - change - 30 Nov 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-11-30 07:41:18
Closed_By alikon
avatar alikon alikon - close - 30 Nov 2020

Add a Comment

Login with GitHub to post a comment