-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3] fix wrong catid for contactcreator #27949
Conversation
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. |
I have tested this item 🔴 unsuccessfully on c510f9d
=> 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. |
@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.
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. |
@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? |
@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 ✅ successfully on c510f9d This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27949. |
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. |
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. |
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