? ? Pending

User tests: Successful: Unsuccessful:

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
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 24 Jul 2020
Category Administration com_templates
avatar shim-sao shim-sao - change - 24 Jul 2020
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2020-07-24 16:16:01
Closed_By shim-sao
Labels Added: ?
avatar shim-sao shim-sao - close - 24 Jul 2020
avatar alikon
alikon - comment - 24 Jul 2020

@shim-sao did you close this by mistake ?

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

It is my first PR with fork. I don't really know how it work :(

avatar Quy Quy - change - 24 Jul 2020
Status Closed New
Closed_Date 2020-07-24 16:16:01
Closed_By shim-sao
avatar Quy Quy - change - 24 Jul 2020
Status New Pending
avatar Quy Quy - reopen - 24 Jul 2020
avatar alikon
alikon - comment - 24 Jul 2020

no problem at all , all of us have started this way... ?

but please write

  • Testing Instructions
  • Actual result BEFORE applying this Pull Request
  • Expected result AFTER applying this Pull Request
avatar shim-sao shim-sao - change - 24 Jul 2020
The description was changed
avatar shim-sao shim-sao - edited - 24 Jul 2020
avatar shim-sao
shim-sao - comment - 24 Jul 2020

It is attached to an issues but I don't know where doing this.

avatar richard67 richard67 - test_item - 26 Jul 2020 - Tested successfully
avatar richard67
richard67 - comment - 26 Jul 2020

I have tested this item successfully on 26d4f96

1. Code-review: The change is correct.
2. Real test: Successful, i.e. without that patch, the menu assignments are not saved, and with the patch they are saved.


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

avatar richard67
richard67 - comment - 26 Jul 2020

@SharkyKZ If you have a bit time, could you test, too? Thanks in advance.

avatar alikon alikon - test_item - 26 Jul 2020 - Tested successfully
avatar alikon
alikon - comment - 26 Jul 2020

I have tested this item successfully on 26d4f96


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

avatar alikon alikon - change - 26 Jul 2020
Status Pending Ready to Commit
avatar alikon
alikon - comment - 26 Jul 2020

rtc


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

avatar infograf768
infograf768 - comment - 26 Jul 2020

Do we still have a cs?
We have
->where('(' . $db->quoteName('checked_out') .' IS NULL OR ' . $db->quoteName('checked_out') . ' = :userid)')
Should not we have
->where('(' . $db->quoteName('checked_out') . ' IS NULL OR ' . $db->quoteName('checked_out') . ' = :userid)')

i.e. a space missing between the period and the singlequote?

avatar richard67 richard67 - change - 26 Jul 2020
Status Ready to Commit Pending
avatar richard67
richard67 - comment - 26 Jul 2020

Back to pending. @shim-sao please apply the suggested changes to fix PHP code style.

@infograf768 You are right. No idea though why the PHPCS check by drone didn't find it.


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

avatar richard67 richard67 - test_item - 27 Jul 2020 - Tested successfully
avatar richard67
richard67 - comment - 27 Jul 2020

I have tested this item successfully on 39e1640


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

avatar richard67 richard67 - alter_testresult - 27 Jul 2020 - alikon: Tested successfully
avatar richard67 richard67 - change - 27 Jul 2020
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 27 Jul 2020

Changes after last 2 successful tests were only code style, so these tests are still valid => RTC.


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

avatar Quy Quy - change - 27 Jul 2020
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-07-27 15:03:05
Closed_By Quy
Labels Added: ?
avatar Quy Quy - close - 27 Jul 2020
avatar Quy Quy - merge - 27 Jul 2020
avatar Quy
Quy - comment - 27 Jul 2020

Thanks

Add a Comment

Login with GitHub to post a comment