? ? Pending

User tests: Successful: Unsuccessful:

avatar alikon
alikon
16 Feb 2020

Pull Request for Issue #27946 .

Summary of Changes

fixed the wrong category id for Plugin contactcreator

Testing Instructions

Enable the user plugin contactcreator
Enable registering of users in users options
Register as new user.

Expected result

The newly generated contact has categoy "uncategorised" of com_contact.

Actual result

The generated contact has catid = 34

Documentation Changes Required

maybe a better explanation of tefeature

326e1cf 16 Feb 2020 avatar alikon mysql
c510f9d 16 Feb 2020 avatar alikon mssql
avatar alikon alikon - open - 16 Feb 2020
avatar alikon alikon - change - 16 Feb 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 16 Feb 2020
Category SQL Installation Postgresql MS SQL
avatar chmst
chmst - comment - 16 Feb 2020

I have tested this item successfully on c510f9d

Test on mysql.


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

avatar chmst chmst - test_item - 16 Feb 2020 - Tested successfully
avatar bembelimen
bembelimen - comment - 16 Feb 2020

I have tested this item ? unsuccessfully on c510f9d

Use case:

  • Delete the category
  • Try again

=> non existing category ID is saved

Potential solution(?): have no value at all and/or check before saving if the category exists.


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

avatar bembelimen bembelimen - test_item - 16 Feb 2020 - Tested unsuccessfully
avatar Bakual
Bakual - comment - 16 Feb 2020

@bembelimen This only sets values which are valid for a new installation. As soon as you delete the category or modify stuff, those values aren't valid anymore. That's true for every single value set during installation.
The solution for this "issue" is simple: Check and save the plugin parameters, then it works again.

Potential solution(?): have no value at all and/or check before saving if the category exists.

No value set means the plugin never will work out of the box. With the values set, it works as long as the category isn't deleted, which is probably the case for most sites.
When you edit and save the plugin parameters, you don't have to check if the category exists. It will always only save an existing category.

avatar richard67
richard67 - comment - 16 Feb 2020

@alikon @Bakual Would it make some sense to add some php code to script.php for changing the category value in the params on updates from previous versions where this parameter was wrong? I know we could also do it in update sql with find and replace but that always was a bit dangerous ;-)

@bembelimen Could you change back your test result to not tested with respect to @Bakual 's explanation above?

avatar Bakual
Bakual - comment - 16 Feb 2020

Would it make some sense to add some php code to script.php for changing the category value in the params on updates from previous versions where this parameter was wrong? I know we could also do it in update sql with find and replace but that always was a bit dangerous ;-)

@richard67 I wouldn't do that, and we never did in the past when we had similar issues. People just have to save the plugin parameters to get the correct category, so it's not like it's hard to fix.

avatar jwaisner
jwaisner - comment - 17 Feb 2020

I have tested this item successfully on c510f9d


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

avatar jwaisner jwaisner - test_item - 17 Feb 2020 - Tested successfully
avatar jwaisner jwaisner - change - 17 Feb 2020
Status Pending Ready to Commit
avatar jwaisner
jwaisner - comment - 17 Feb 2020

RTC based on 2 successful tests and 1 test that the result was not part of this PR.


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

avatar bembelimen
bembelimen - comment - 19 Feb 2020

I still think, that this PR does improve the current status of the code, but does not makes it 100% correct (less wrong is still wrong).

What should happen to make it correct is, that here: https://github.com/joomla/joomla-cms/blob/staging/plugins/user/contactcreator/contactcreator.php#L71-L78 the category should be loaded and checked, if it exists and has the right extension etc. otherwise throw an error.

avatar Bakual
Bakual - comment - 19 Feb 2020

You can of course further improve the code. However that is out of scope for this PR and this PR would still be needed.

avatar rdeutz rdeutz - change - 20 Feb 2020
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-02-20 22:37:12
Closed_By rdeutz
Labels Added: ? ?
avatar rdeutz rdeutz - close - 20 Feb 2020
avatar rdeutz rdeutz - merge - 20 Feb 2020

Add a Comment

Login with GitHub to post a comment