Fix Notice error for undefined array and avoid 404 when associations are disabled #10366
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request for Issue # .
Summary of Changes
Fix Notice error for undefined array and avoid 404 using the TOS with original language in case of multi-language association is disabled and an article from a different language than the current used is configured.
Testing Instructions
No Error Fix
Create a single language website environment and enable the profile plugins in order to request the custom TOS field in the user registration form
Check that no PHP Notice errors raise.
No Association Fix
Create a multi language website environment and enable the profile plugins in order to request the custom TOS field in the user registration form.
Select an article.
In the Language Filter plugin disable the Item Associations
Try to register using a different front end language than the one associated to the TOS article previously chosen.
Check that the TOS is correctly linked to the article originally selected, despite the current language is different (so avoiding 404)