? Success
Pull Request for # 9593

User tests: Successful: Unsuccessful:

avatar dgt41
dgt41
30 Mar 2016

Pull Request for Issue #9593 .

Summary of Changes

mootools modal needs the field id

Testing Instructions

Switch to the Hathor template. I know it's out of date and never updated, but it serves this point for now. Go to Content > Articles > Add New Article. Click on the User icon next to the Created By field. The Modal window shows up (it should be based on MooTools). Click on any user in there and nothing happens.
Apply patch redo. Also check that isis still works as expected

Kudos to @OctavianC for finding and proposing the solution

Votes

# of Users Experiencing Issue
0/1
Average Importance Score
3.00

avatar dgt41 dgt41 - open - 30 Mar 2016
avatar dgt41 dgt41 - change - 30 Mar 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 30 Mar 2016
Labels Added: ?
avatar RonakParmar
RonakParmar - comment - 30 Mar 2016

I have followed above steps and not able to reproduce this issue.
Here is my system information:

Joomla! Version: Joomla! 3.4.8 Stable [ Ember ] 24-December-2015 19:30 GMT
Joomla! Platform Version: Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
PHP Version: 5.4.45-3+deb.sury.org~precise+1
System Linux desktop


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

avatar OctavianC
OctavianC - comment - 30 Mar 2016

I appreciate you for stepping in @dgt41 :)
However, since the fielduser.js file only injects the click event when the Bootstrap Modal is loaded, there's also a need to modify administrator/components/com_users/views/users/tmpl/modal.php and add:

onclick="if (window.parent && window.parent.jSelectUser) window.parent.jSelectUser(this);"

Wherever the following is encountered:

data-user-field="<?php echo $this->escape($field);?>"

This makes setValue() somehow redundant:

// set the value
$.fieldUser.prototype.setValue = function(value, name) {
    this.$input.val(value).trigger('change');
    this.$inputName.val(name || value).trigger('change');
};

... since the onclick HTML attribute will trigger as well. I can see an isolated issue where jModalClose() is not defined and would make jSelectUser() throw an error. Perhaps changing this:

// handle value select
content.on('click', '.button-select', function(){
    self.setValue($(this).data('user-value'), $(this).data('user-name'));
    self.modalClose();
    $('body').removeClass('modal-open');
});

... to also remove the HTML attribute would solve it when using Bootstrap Modals?

$(this).removeAttr('onclick');
avatar brianteeman brianteeman - change - 30 Mar 2016
Rel_Number 0 9593
Relation Type Pull Request for
avatar brianteeman brianteeman - change - 30 Mar 2016
Category Fields JavaScript
avatar mikeveeckmans mikeveeckmans - test_item - 30 Mar 2016 - Tested successfully
avatar mikeveeckmans
mikeveeckmans - comment - 30 Mar 2016

I have tested this item :white_check_mark: successfully on 0fe32ce

TEST OK

but please never make me use Hathor again :-P


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

avatar brianteeman brianteeman - test_item - 31 Mar 2016 - Tested successfully
avatar brianteeman
brianteeman - comment - 31 Mar 2016

I have tested this item :white_check_mark: successfully on 0fe32ce


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

avatar brianteeman brianteeman - change - 31 Mar 2016
Status Pending Ready to Commit
avatar brianteeman
brianteeman - comment - 31 Mar 2016

RTC


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

avatar joomla-cms-bot joomla-cms-bot - change - 31 Mar 2016
Labels Added: ?
avatar brianteeman brianteeman - change - 31 Mar 2016
Milestone Added:
avatar OctavianC
OctavianC - comment - 31 Mar 2016

hathor has template overrides for administrator/components/com_users/views/users/tmpl/modal.php (here: https://github.com/joomla/joomla-cms/blob/staging/administrator/templates/hathor/html/com_users/users/modal.php#L66) which calls if (window.parent) window.parent.jSelectUser(this);. If you use any other template, the Modal will fail even after applying this patch.

avatar brianteeman
brianteeman - comment - 31 Mar 2016

I thought about that when I was testing and was able to select the user in
com_content before and after the patch when using isis

On 31 March 2016 at 09:54, Octavian Cinciu notifications@github.com wrote:

hathor has template overrides for
administrator/components/com_users/views/users/tmpl/modal.php (here:
https://github.com/joomla/joomla-cms/blob/staging/administrator/templates/hathor/html/com_users/users/modal.php#L66)
which calls if (window.parent) window.parent.jSelectUser(this);. If you
use any other template, the Modal will fail even after applying this patch.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#9659 (comment)

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

avatar OctavianC
OctavianC - comment - 31 Mar 2016

Isis has layout overrides - fielduser.js takes into account only Bootstrap 2 Modals. Any other Modals (MooTools) and the onclick event won't be triggered. If you'll be using another administrator template (unlikely, but why are we supporting templates if they don't work then?) without a template override for modal.php clicking on a user won't do anything.

Without my proposed changes above this won't be fixed entirely, it will only be fixed for hathor.

avatar brianteeman brianteeman - change - 31 Mar 2016
Status Ready to Commit Pending
Labels
avatar brianteeman
brianteeman - comment - 31 Mar 2016

Removed RTC


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

avatar joomla-cms-bot joomla-cms-bot - change - 31 Mar 2016
Labels Removed: ?
avatar joomla-cms-bot
joomla-cms-bot - comment - 1 Apr 2016

This PR has received new commits.

CC: @brianteeman, @mikeveeckmans


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

avatar brianteeman brianteeman - change - 2 Apr 2016
Title
Fix for issue #9593
JFormFieldUser broken since 3.5.0
avatar brianteeman brianteeman - change - 2 Apr 2016
Title
Fix for issue #9593
JFormFieldUser broken since 3.5.0
avatar mikeveeckmans mikeveeckmans - test_item - 2 Apr 2016 - Tested successfully
avatar mikeveeckmans
mikeveeckmans - comment - 2 Apr 2016

I have tested this item :white_check_mark: successfully on d6a8353

TEST OK


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

avatar OctavianC
OctavianC - comment - 4 Apr 2016

Tested successfully:

avatar brianteeman brianteeman - alter_testresult - 4 Apr 2016 - OctavianC: Tested successfully
avatar brianteeman brianteeman - change - 4 Apr 2016
Status Pending Ready to Commit
avatar brianteeman
brianteeman - comment - 4 Apr 2016

Set back to RTc - thanks everyone


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

avatar joomla-cms-bot joomla-cms-bot - change - 4 Apr 2016
Labels Added: ?
avatar rdeutz rdeutz - change - 12 Apr 2016
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-04-12 20:04:12
Closed_By rdeutz
avatar rdeutz rdeutz - close - 12 Apr 2016
avatar rdeutz rdeutz - merge - 12 Apr 2016
avatar joomla-cms-bot joomla-cms-bot - close - 12 Apr 2016
avatar rdeutz rdeutz - reference | c8c2d20 - 12 Apr 16
avatar rdeutz rdeutz - merge - 12 Apr 2016
avatar rdeutz rdeutz - close - 12 Apr 2016
avatar joomla-cms-bot joomla-cms-bot - change - 12 Apr 2016
Labels Removed: ?
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Removed:
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Added:
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Added:
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Removed:

Add a Comment

Login with GitHub to post a comment