There are two ways to reproduce this:
/html/layouts/joomla/form/field/user.php
. I do understand that they need overrides to use Bootstrap, but if I remove them I would expect them unstyled but functional. Removing overrides and re-doing the steps above will exhibit the same error.
#### Expected resultClicking on a user should close the modal window and assign the user to the hidden field.
Clicking on a user does nothing.
Joomla! 3.5.0 Stable [ Unicorn ] 21-March-2016 22:00 GMT
Seems to be caused by #5655
I've noticed this part https://github.com/joomla/joomla-cms/blob/staging/layouts/joomla/form/field/user.php#L50 that seems strange to me:
. ($required ? 1 : 0) . '&field={field-user-id}'
I'm guessing replacing it with:
. ($required ? 1 : 0) . '&field=' . htmlspecialchars($id, ENT_COMPAT, 'UTF-8')
Would do the trick. But I'm not sure if I'm missing something.
Category | ⇒ | Fields Layout |
Labels |
Added:
?
|
I'm not sure how jSelectUser is supposed to be triggered by MooTools modals since the function is not called onclick
in administrator/components/com_users/views/users/tmpl/modal.php
.
I did some tests and can try a PR, but I'm not sure if I entirely understand the point of fielduser.js
- it will only inject the click event in Bootstrap modals.
TLDR: My 2 cents: inject the onclick
event on page load so it works across all modals and call jSelectUser()
because why not, since it does what it's supposed to.
@OctavianC The main difference between the mootools code and the bootstrap is that the later will allow to initialise fields dynamically (this was a prerequisite for the next version of repeatable forms), so in that sense the id is kinda irrelevant where the mootools script (and that kept for B/C) expects the id to be unique etc...
Few of the aims for all the fields should be:
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-03-30 09:20:29 |
Closed_By | ⇒ | brianteeman |
Closed as we have a PR #9659 for testing
After upgrading to 3.6.0 selecting users in external components seems to be broken. Clicking on one in e.g. Akeeba Subscription causes following error in console: window.parent.jSelectUser is not a function
After adding following line
JHtml::script('jui/fielduser.min.js', false, true, false, false, true);
there is no error in console, but clicking on name still gives no effect in that particular component.
Does changes made in 3.5.0 require components to be adjusted in order to work with forms, specifically user selection?
@marclight update to 3.6.4
Have you asked akeeba for support?
@brianteeman I wish, they don't support Akeeba Subscriptions anymore. Google sent me here because of what @molszews posted. Was hoping he might got it working.
@marclight do you have the code from #10791 to your site?
@marclight still no luck
This is not an issue with Joomla! - I've debugged the code and found that Akeeba Subscriptions does not use the JFormFieldUser field - it uses its own HTML, so that's why it isn't working.
@OctavianC THanks for the info.
@molszews I'll put a dev on it and if we make it work, I'll let you know.
Workaround:
Open /administrator/components/com_akeebasubs/views/user/tmpl/form.php
After:
<script type="text/javascript">
Add:
function jSelectUser(element)
{
jSelectUser_userid(jQuery(element).data('user-value'), jQuery(element).data('user-name'));
}
@OctavianC I still get the following:
Uncaught TypeError: window.parent.jSelectUser is not a function at HTMLAnchorElement.onclick
Just tested it and it works, perhaps you need to add it in another view that uses modals (found multiple - user, subscription, coupon etc). Sorry, we're going off-topic.
@OctavianC Added the function in all the views and it now works! Thanks a million ans sorry too for going off topic :)
@dgt41