avatar shim-sao
shim-sao
24 Jul 2020

Steps to reproduce the issue

Save a template style with menu assignments (4.0-beta-3-dev)

Expected result

Template style saved with menu assignments

Actual result

None of the menu assignments are saved

System information (as much as possible)

Joomla 4.0-beta-3-dev - Linux - PHP 7.4.8 - MySql 5.7.28

Additional comments

In the Administrator StyleModel.php function Save, replace in the 2 queries :

->whereIn($db->quoteName('checked_out'), [null, $userId])

by something like :

->where($db->quoteName('checked_out') .' IS NULL OR ' . $db->quoteName('checked_out') . ' = :userid')

->bind(':userid', $userid, ParameterType::INTEGER)

I think maybe there is something wrong in the query with whereIn php null and the mysql check IS NULL

= NULL or IN (NULL) may not work sometimes

->where($db->quoteName('checked_out') . '= NULL') => not work

->whereIn($db->quoteName('checked_out'), [null]) => not work

avatar shim-sao shim-sao - open - 24 Jul 2020
avatar shim-sao shim-sao - change - 24 Jul 2020
The description was changed
avatar shim-sao shim-sao - edited - 24 Jul 2020
avatar SharkyKZ
SharkyKZ - comment - 24 Jul 2020

Your fix is correct. Do you want to submit a PR?

avatar shim-sao
shim-sao - comment - 24 Jul 2020

Ok, thank you, it's done.

avatar Quy Quy - change - 24 Jul 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-07-24 16:47:26
Closed_By Quy
avatar Quy
Quy - comment - 24 Jul 2020

PR #30183 Thanks.

avatar Quy Quy - close - 24 Jul 2020

Add a Comment

Login with GitHub to post a comment