Built-In Property 'User' Not Working

Permalink
I am having issues with Concrete5's Build-In 'User' Property on the composer form for new pages. When clicking "Select User" the page navigates to
http://website.com/ccm/system/dialogs/user/search
. But that page is completely blank.

When you go into the attributes tab and click "Select User" under "Author" it also has the URL
http://website.com/ccm/system/dialogs/user/search
, but instead of reopening the page, it launches the user selector within the current page. This, I believe, is accomplished using the following JavaScript:

$(function() {
        $("#ccm-user-selector-uID").dialog();
        $("#ccm-user-selector-uID").on('click', function() {
            var selector = $(this);
            ConcreteEvent.unsubscribe('UserSearchDialogSelectUser.core');
            ConcreteEvent.subscribe('UserSearchDialogSelectUser.core', function(e, data) {
                var par = selector.parent().find('.ccm-summary-selected-item-label'),
                pari = selector.parent().find('[name=uID]');
                par.html(data.uName);
                pari.val(data.uID);
                e.stopPropagation();
                jQuery.fn.dialog.closeTop();
            });
            ConcreteEvent.subscribe('UserSearchDialogAfterSelectUser', function(e) {
                jQuery.fn.dialog.closeTop();


The 'User' option in the Composer has very similar JavaScript associated with it, replacing only the selectors.

$(function() {
        $("#ccm-user-selector-ptComposer[13][user]").dialog();
        $("#ccm-user-selector-ptComposer[13][user]").on('click', function() {
            var selector = $(this);
            ConcreteEvent.unsubscribe('UserSearchDialogSelectUser.core');
            ConcreteEvent.subscribe('UserSearchDialogSelectUser.core', function(e, data) {
                var par = selector.parent().find('.ccm-summary-selected-item-label'),
                pari = selector.parent().find('[name=ptComposer[13][user]]');
                par.html(data.uName);
                pari.val(data.uID);
                e.stopPropagation();
                jQuery.fn.dialog.closeTop();
            });
            ConcreteEvent.subscribe('UserSearchDialogAfterSelectUser', function(e) {
                jQuery.fn.dialog.closeTop();


I can't find anything that is keeping the functionality form working as expected on the Composer section, like it does on the Attributes section when creating a new page.

Has anyone else run into this or have any ideas on what might be the problem?

 
Jeremy1026 replied on at Permalink Reply
Turns out the issue was related to the two following lines:

$("#ccm-user-selector-ptComposer[13][user]").dialog();
    $("#ccm-user-selector-ptComposer[13][user]").on('click', function() {


They aren't valid ID's and thus jQuery couldn't find them. A hacky solution to solve the issue was to replace lines 38 and 39 in `concrete/src/Form/Service/Widget/UserSelector.php` with

$("[id='ccm-user-selector-{$fieldName}']).dialog();
   $("[id='ccm-user-selector-{$fieldName}']).on('click', function() {


Which allows for it to search out any elements that have an ID that matches that string.