-
-
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
Tidy writeDynaList() #12184
Merged
Merged
Tidy writeDynaList() #12184
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5d9f7a9
Cleaned writeDynaList() in core.js
milux 5fbdbba
Removed explanation comments
milux 44f3764
removed all API changes
milux 3d0bccd
Merge remote-tracking branch 'upstream/staging' into staging
milux a4759c5
Merge branch 'staging' into staging
rdeutz 712332f
Merge remote-tracking branch 'upstream/staging' into staging
milux df4e057
updated compressed core.js
milux 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 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ | |
for (i = 0; i < response.data.length; ++i) { | ||
$orders[i] = response.data[i].split(','); | ||
} | ||
writeDynaList('name="' + $name + '" id="' + $id +'"' + $attr, $orders, $originalPos, $originalPos, $originalOrder, $element); | ||
writeDynaList('name="' + $name + '" id="' + $id +'"' + $attr, $orders, $originalPos, $originalOrder, $element); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why are you dropping one viable here? The function needs 6 vars and you end up using 5? This looks wrong... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Edit: Fixed, see below. |
||
} | ||
} | ||
|
||
|
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.
what will happen if someone call this function without setting the element?
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.
The same as with every other function that is not called according to its definition: It will fail to do its job. In this case, the result is an unchanged DOM.
I removed the else branch because the current implementation is only used in a place where the element is specified, and document.write(ln) is one of the most awful things ever seen in JS, comparable to eval(). Such functions do only cause headache and should imho die out asap.
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.
@milux I will totally agree with you but, (in Joomla there is almost always a but) the core.js API cannot change because there might be some 3rd PD that uses it and depends on the
writeln()
, so if that is changed a B/C break is introduced. Same goes for the params. I could have done this when I did #11040 but unfortunately we can't break B/C in minor versions.You can rebase this PR against 4.0-dev branch, as the backwards compatibility is not an issue there
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.
Ah, I see... you're right, I didn't consider that this might be used by any 3rd party stuff. (I doubt it, to be honest, but when you guarantee API stability...).
Fine, I will redo anything that changed the public API, some changes might still be useful.