User tests: Successful: Unsuccessful:
Pull Request for Issue #32185 .
The fields Media and User have a dependency on the Bootstrap Modal but the order of the execution is wrong. The modal helper function needs to be called before including the field's own script
Created By
, Intro Image
and Full Article Image
fields still workingNo
Status | New | ⇒ | Pending |
Category | ⇒ | Layout |
Labels |
Added:
?
|
But I get this warning in the form: Notice: Undefined variable: uri in /Users/ceford/Sites/joomla-cms-4/layouts/joomla/form/field/user.php on line 61.
This should be fixed now with bf8f7ec
I did not understand the testing instructions concerning User field in Article edit
Got to the Publishing tab and check the field Created By
The notice in user field is ok now, but I stll have the error "uncaught.." in media field.
The notice in user field is ok now, but I stll have the error "uncaught.." in media field.
What URL?
New article
Category | Layout | ⇒ | JavaScript Repository NPM Change Layout |
Labels |
Added:
NPM Resource Changed
|
@dgrammatiko a better fix is to to call Joomla.initialiseModal(this.modalElement, {isJoomla: true });
not in connectedCallback()
, but on first interaction, lazylly, and have an internal flag to mark that Joomla.initialiseModal
was called.
Additionally, instead of callback I would use event:
Joomla.Event.dispatch(this.modalElement, 'joomla:initModal', {isJoomla: true });
So it does not strict to have Joomla.initialiseModal
, and anyone can listen to this event.
You see, it useful
but on first interaction, lazylly, and have an internal flag to mark that Joomla.initialiseModal was called.
True, that a better implementation (btw this PR was done on Github UI, so...)
Additionally, instead of callback I would use event:
In general, I will agree with you here that events are a better way. There are couple caveats here:
Joomla.initialiseModal
is kinda a wrapper around itbootstrap.Modal(element)
, so I guess easier for Joomla devs (might be wrong here)<bootstrap-modal>
we try to apply all the interactivity on a <div>
...A way better model is Custom Elements,
Well, it already Custom Element
I understood what you mean, however it not really a fix, example when on frondend I want to use FooBarModal.js instead of BotCrap.js.
Event or Callback still better in this case, because I can disable botcrap.js, and hook up my script.
btw this PR was done on Github UI
Not bad as for Github UI
I have tested this item
I understood what you mean, however it not really a fix, example when on frondend I want to use FooBarModal.js
That's the big problem of HTMLHelper
and FormField
they need to become client-specific. Actually this is one of the major problems of Joomla and somehow it needs a realistic solution so finally the backend could be decoupled from the frontend.
That's the big problem of HTMLHelper
I tried to reduce use of HTMLHelper::_('bootstrap.foobar')
(and such) calls to $wa->useScript('bootstrap.foobar')
, but I see someone added much more fancy code there
But not much important.
I see someone added much more fancy code there
If you have a better way then go ahead and change the code there. All I wanted to do there was to modularise the JS, eg include only the JS you need per route (instead of bringing both jQuery and the whole Bootstrap library even if all you wanted was a collapse component).
when will have some more time.
Yeah let's patch only the really breaking or bad things for now and hopefully, we can improve things later on
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-01-31 23:29:21 |
Closed_By | ⇒ | wilsonge | |
Labels |
Added:
?
|
Thanks!
I did not understand the testing instructions concerning User field in Article edit. However, in Users / Add User Note I get Uncaught ReferenceError: bootstrap is not defined which goes away after applying the patch. But I get this warning in the form: Notice: Undefined variable: uri in /Users/ceford/Sites/joomla-cms-4/layouts/joomla/form/field/user.php on line 61.
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32193.