User tests: Successful: Unsuccessful:
Pull Request for Issue #27946 .
fixed the wrong category id for Plugin contactcreator
Enable the user plugin contactcreator
Enable registering of users in users options
Register as new user.
The newly generated contact has categoy "uncategorised" of com_contact.
The generated contact has catid = 34
maybe a better explanation of tefeature
Status | New | ⇒ | Pending |
Category | ⇒ | SQL Installation Postgresql MS SQL |
I have tested this item
Use case:
=> non existing category ID is saved
Potential solution(?): have no value at all and/or check before saving if the category exists.
@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.
@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?
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.
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC based on 2 successful tests and 1 test that the result was not part of this PR.
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.
You can of course further improve the code. However that is out of scope for this PR and this PR would still be needed.
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:
?
?
|
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.