-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
BUG: Sample Data blog various issues #17930
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9c85323
BUG: Sample Data blog various issues
infograf768 609f4c2
Correcting truncate code
infograf768 88daa64
Simplifying articles aliases creation
infograf768 ba47e90
Using unicode aliases when language is not using latin glyphs
infograf768 cca4fef
correct truncate (again)
infograf768 b26b55b
Makung sure unicodeslugs is reverted to the configuration settings
infograf768 be9978d
Tweak config reset
mbabker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably reset this to whatever value it was beforehand. Right now this causes a side effect of changing the setting for everything that happens after this call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be limited to the method concerned?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean limited to the method
Adding
$unicode = JFactory::getConfig()->get('unicodeslugs', 1);
And at the end of the method
JFactory::getConfig()->set('unicodeslugs', $unicode);
And this for each method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There shouldn't be anything happening after that code which could produce any side effects. Only the AJAX response is left to be done by com_ajax.
But yeah, better safe than sorry 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anytime you're making a configuration change if it's supposed to be temporary to work around an issue it should be immediately reverted to the state it was before just to make sure nothing unexpected happens. As this one specifically is the first conditional hit in this step, if the configuration is changed then as is everything calling
stringURLSafeafterwards (or anything relying on theunicodeslugsparam) is arbitrarily left withunicodeslugs = 1. Granted, the chances of this particular thing causing side effects is low, it is best practice to always reset a temporary change.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will modify asap. I had tested though that after this temporary change, the real value is not changed in configuration.php when the script has finished running.