Skip to content
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

[4.0] Fix webcomponents not being included on the page #24075

Merged
merged 1 commit into from Mar 3, 2019

Conversation

Projects
None yet
7 participants
@wilsonge
Copy link
Contributor

commented Mar 3, 2019

A b/c break in #19972 has caused web components scripts to no longer be enqueued for use by core.js - this reworks the webcomponent jhtml call to be a bit cleaner and work around the b/c break

@wilsonge

This comment has been minimized.

Copy link
Contributor Author

commented Mar 3, 2019

@dgrammatiko as you posted on the original PR

Edge case if someone used this code to actually replace the values in the storage but then again I don't think that many people are actually using or even understand the Joomla.storageOptions.

I think that’s exactly what we are doing with webcomponents. We have added a single element array and rely on it merging into the existing array elements. After that PR the last entry overwrites the one before it :/

@wilsonge

This comment has been minimized.

Copy link
Contributor Author

commented Mar 3, 2019

Drone passes now so this is definitely the root cause (although not definitely the right fix)

@wilsonge

This comment has been minimized.

Copy link
Contributor Author

commented Mar 3, 2019

@SniperSister @zero-24 can you look into drone here so that it’s passing rips when everything here is fine please?

@dgrammatiko

This comment has been minimized.

Copy link
Contributor

commented Mar 3, 2019

@wilsonge changing it to array_merge_recursive fixes this?

@Hackwar

This comment has been minimized.

Copy link
Member

commented Mar 3, 2019

My way to fix this was going to libraries/src/Html/HtmlHelper.php line 778 and exchanging 'js' with 'webcomponents/js'

@dgrammatiko

This comment has been minimized.

Copy link
Contributor

commented Mar 3, 2019

@Hackwar I don't think there is a webcomponents folder anymore...

@Hackwar

This comment has been minimized.

Copy link
Member

commented Mar 3, 2019

I ran composer update and npm clean-install several times...

@Hackwar

This comment has been minimized.

Copy link
Member

commented Mar 3, 2019

Ok, if we don't have a webcomponents folder anymore, as seems to be the case, then this here is wrong:

HTMLHelper::_('webcomponent', 'system/joomla-toolbar-button.min.js', ['version' => 'auto', 'relative' => true]);

@Hackwar

This comment has been minimized.

Copy link
Member

commented Mar 3, 2019

Or rather this here:

HTMLHelper::_('webcomponent', 'system/fields/joomla-toolbar-button.min.js', ['relative' => true, 'version' => 'auto', 'detectDebug' => true]);

@dgrammatiko

This comment has been minimized.

Copy link
Contributor

commented Mar 3, 2019

@Hackwar nope, that's correct:
HTMLHelper::_('webcomponent', 'system/joomla-toolbar-button.min.js', ['version' => 'auto', 'relative' => true]);

Break down:

  • 'webcomponent' calls the fn webcomponent
  • 'system/joomla-toolbar-button.min.js' The path
  • 'relative' => true] The path is relative eg real path: system/js/joomla-toolbar-button.min.js
  • 'version' => 'auto' Version string applied, eg: ?fdkjhkldjfhk
@Hackwar

This comment has been minimized.

Copy link
Member

commented Mar 3, 2019

I understand that, but these 2 calls reference the same file, while one exists and the other not. see dec68e1#diff-169f9020e1f708bc04e7ca0605989ac5R15

@dgrammatiko

This comment has been minimized.

Copy link
Contributor

commented Mar 3, 2019

@Hackwar yeah that's a bug, you can blame me for that. In sort the toolbar is not a field thus the script shouldn't live in that folder

@wilsonge

This comment has been minimized.

Copy link
Contributor Author

commented Mar 3, 2019

@Hackwar I fixed that one already #24074

@wilsonge

This comment has been minimized.

Copy link
Contributor Author

commented Mar 3, 2019

The problem is, is where and how we want to fix the “break” given this was merged and released in August in 3.8. We can change the function here back/to array recursive merge OR we can change web components understanding the value will get overwritten. Tempted for the latter to reduce b/c breaks?

@bembelimen

This comment has been minimized.

Copy link
Contributor

commented Mar 3, 2019

Tempted for the latter to reduce b/c breaks?

Yes please! This fix wasn't without reason ;)

@roland-d

This comment has been minimized.

Copy link
Contributor

commented Mar 3, 2019

@wilsonge Tested this successfully. Current 4.0-dev the toolbar buttons are broken. This fix makes it work again.

@dgrammatiko

This comment has been minimized.

Copy link
Contributor

commented Mar 3, 2019

This fix wasn't without reason

If the only use case is tinyMCE then probably that's not a big problem as I see J4 coming out with the new tinyMCE which of course will break B/C with the old crappy way of initialising the editor (in sort will not use scriptOptions)

@wilsonge wilsonge force-pushed the wilsonge:webcomponent-include-fix branch from 896efbb to 985e196 Mar 3, 2019

@wilsonge

This comment has been minimized.

Copy link
Contributor Author

commented Mar 3, 2019

Reworked the webcomponent part and cleaned it up at the same time. Please test this now. In retrospect I really wish we'd done a recursive merge instead of recursive replace. But unfortunately the ship has sailed - and given it's easy to work around this for webcomponents here - I'm not going to try and introduce an unncessary b/c break again

@wilsonge wilsonge marked this pull request as ready for review Mar 3, 2019

@wilsonge wilsonge force-pushed the wilsonge:webcomponent-include-fix branch from 985e196 to db78ac2 Mar 3, 2019

@Hackwar

This comment has been minimized.

Copy link
Member

commented Mar 3, 2019

I have tested this item successfully on db78ac2


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24075.

@roland-d

This comment has been minimized.

Copy link
Contributor

commented Mar 3, 2019

I have tested this item successfully on db78ac2

Buttons working again after applying PR


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24075.

@zero-24 zero-24 added this to the Joomla 4.0 milestone Mar 3, 2019

@zero-24 zero-24 merged commit 9a80848 into joomla:4.0-dev Mar 3, 2019

4 checks passed

JTracker/HumanTestResults Human Test Results: 2 Successful 0 Failed.
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/drone/pr the build was successful
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@zero-24

This comment has been minimized.

Copy link
Contributor

commented Mar 3, 2019

Merged thanks.

@wilsonge

This comment has been minimized.

Copy link
Contributor Author

commented Mar 3, 2019

Thanks!

@wilsonge wilsonge deleted the wilsonge:webcomponent-include-fix branch Mar 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.