Author user search attribute failing - impossible to select authors

Permalink Browser Info Environment
1.) On add blog (dashboard/problog/add_blog), click "Select User".
2.) With over 10 users, click on of the pages in pagination. The pagination will disappear, and the UI will appear to load a duplication version inside of itself. (shot #1)
3.) Alternatively, rather than clicking the page number, if you try to use one of the filters (such as # of pages, or changing the sort order with the sort headings), when you click a username, it will JS alert you with the uID, the name, and email, then close the dialog without choosing the user. (shot #2)

I believe this is due to the custom user picker attribute loading in the wrong heading element (it's loading in the c5 user picker filtration options, which will AJAX in the c5 user picker elements, not the ProBlog ones). This occurs on problog/tools/users/search_dialog.php on line 21.

2 Attachments

Type: Discussion
Status: In Progress
EvanCooper
View Replies:
RadiantWeb replied on at Permalink Reply
RadiantWeb
Hi there,

This is an auto responder to let you know that your support ticket has been forwarded to our entire support team at RadiantWeb!

Support tickets are reviewed Mondays thru Fridays 9am to 9pm & Saturdays 9am to 12pm EST.

A support team member will be following up with you as soon as possible.

Thank for supporting RadiantWeb Products!

RadiantWeb Support
http://goradiantweb.com
RadiantWeb replied on at Permalink Reply
RadiantWeb
looking into this.

C
RadiantWeb replied on at Permalink Reply
RadiantWeb
Hi Evan,

The immediate fix for this is to replace line 16 of /packages/problog/models/attribute/types/user_picker/controller.php with

echo  Loader::helper('form/user_selector')->selectUser($fieldName,$value,'ccm_triggerSelectUser');


The custom one was there due to a nasty ccm.app.js bug about a year ago. I got sick of dealing with it so just put my own helper in.

But it looks like 5.6.3+ is fine with the normal helper now.

ChadStrat
RadiantWeb replied on at Permalink Reply
RadiantWeb
next update will reflect this change btw.

C
EvanCooper replied on at Permalink Reply
EvanCooper
Cool, thx!
JohntheFish replied on at Permalink Reply
JohntheFish
Is this fully resolved in 12.4.4? I have a customer who is having problems relating to the user select and ccm_triggerSelectUser() in the dashboard add blog post page.
RadiantWeb replied on at Permalink Reply
RadiantWeb
yes. if you are having issues, it may be js load order causing issues...which can be driven by any number of addons using addToHeader or addToFooter and forcing js to the header or footer. aka- PITA. ....it's anybody's guess.

ChadStrat
JohntheFish replied on at Permalink Reply
JohntheFish
Not seeing any JS issue in the developer console. As this is a dashboard page, the only JS loaded is ProBlog and core.
RadiantWeb replied on at Permalink Reply
RadiantWeb
Any package that has any js in on_start is loaded up as well. Don't know. As far as I know and can test, as well as the many users that use this it is fixed. Can you be more specific? Not selecting? Popup not working? Selecting but not saving? Saving but not rendering a user when reopened? Perhaps open a new ticket and provide more reproducibility.

ChadStrat
JohntheFish replied on at Permalink Reply
JohntheFish
I had checked the js from the developer console. All core scripts with a lot of tinymce plugins for the text editor the form shows.

To select successfully:
From the dashboard add, click to select a user. Scroll/paginate to a user without making a search. Select a user. User is selected OK.

To get the problem:
From the dashboard add, click to select a user. Make a search for a user. Select a user. When the user picker closes, a bunch of alerts are shown and nothing happens. I think these are from the core placeholder for ccm_triggerSelectUser() rather than that supplied by an actual user picker helper.
RadiantWeb replied on at Permalink Reply
RadiantWeb
I don't get that behavior in C5.6.3. What version of C5 are you on? Either way, clearly it's using the user picker helper...so I don't know that there is anything I could do honestly as that is a core helper. But, no I don't see that. If I search and pick a user all works well. I am open to any suggestions or corrections.

C
JohntheFish replied on at Permalink Reply
JohntheFish
The site is 5.6.3.2
ProBlog is 12.4.4
RadiantWeb replied on at Permalink Reply
RadiantWeb
you could try uncommenting line 15 of that attribute controller in ProBlog. perhaps you're just missing that js???? dunno.

ChadStrat
JohntheFish replied on at Permalink Reply
JohntheFish
I have been catching xhr requests in the developer console.

First time the user selector loads, its definitely the problog version from
/index.php/tools/packages/problog/users/search_dialog?mode=choose_one
with selection using ccm_triggerSelectBlogUser(). That works.

When using the search button in the user selector, the new dialog loaded is
index.php/tools/required/users/search_results?mode=choose_one&searchType= etc....
So the search is loading the core user picker that tries to use ccm_triggerSelectUser(), but only the placeholder is present.

Looking at the source of the initial search dialog in the xhr, the search button and form rendered is connected to the core user picker rather than the problog version
<form class="form-horizontal" method="get" id="ccm-user-advanced-search" action="/index.php/tools/required/users/search_results">


As to why this works on your test site, do you have any other addons that could be defining ccm_triggerSelectUser() and thus masking the problem?
RadiantWeb replied on at Permalink Reply
RadiantWeb
this is just utterly confusing to me. The problog version of user select has been completely removed accept for the multi-user select, which is not used accept for subscriptions. Certainly not author. Has someone changed the attribute to be the multi-user picker????

That tools file should not be used. If you look at the attribute type "user_picker" in problog/models/attribute/types/ you can see clearly in the controller its very literally the basic picker helper. The "add_blog" dashboard single page also has no further javascript.

From this I can only conclude a change to the attribute or an override exists. Am I missing something?

ChadStrat
JohntheFish replied on at Permalink Reply
JohntheFish
From what I can trace by code reading, maybe I am missing something.
Package controller v12.4.4, line 541, installs a user picker attribute type from problog
$userpicker = AttributeType::getByHandle('user_picker');
   if(!is_object($userpicker) || !intval($userpicker->getAttributeTypeID()) ) { 
      $userpicker = AttributeType::add('user_picker', t('User Picker'), $pkg);   
      $eaku->associateAttributeKeyType($userpicker);  
   }

Line 553 sets the blog author attribute as a user picker
$blogauth=CollectionAttributeKey::getByHandle('blog_author'); 
   if( !is_object($blogauth) ) {
        CollectionAttributeKey::add($userpicker, 
        array('akHandle' => 'blog_author', 
        'akName' => t('Blog Author')
        ),$pkg)->setAttributeSet($evset); 
     }


Dashboard add blog view, line 86
$auth = CollectionAttributeKey::getByHandle('blog_author');
               if (is_object($blog)) {
                  $authvalue = $blog->getAttributeValueObject($auth);
               }
               ?>
               <div class="blog-attributes">
                  <div style="width: 230px;">
                     <?php      echo $auth->render('form', $authvalue);?>
                  </div>
               </div>


User picker attribute model, line 16:
echo  Loader::helper('user_selector','problog')->selectUser($fieldName,$value,'ccm_triggerSelectBlogUser');


So the problog version of the user selector is being loaded with the ccm_triggerSelectBlogUser() sript called on user selection.
RadiantWeb replied on at Permalink Reply
RadiantWeb
hmmm....I apparently did not push this change to 12.4.4 like I thought I had.

So, does simply changing line 16 of /packages/problog/models/attributes/user_picker/controller.php to this resolve your issue?

echo  Loader::helper('form/user_selector')->selectUser($fieldName,$value,'ccm_triggerSelectUser');


ChadStrat
JohntheFish replied on at Permalink Reply
JohntheFish
With that change,
- search followed by choose now works OK
- search followed by paginate & choose now works OK.

However, if I sort by username or any other column, the link takes me to the user edit page rather than propagating the choose behaviour.
pegheadnation replied on at Permalink Reply
pegheadnation
Hey Chad,

Did you every resolve this issues. I am receiving the same issues as JohntheFish. The first panel that pops up has the functions

"javascript:void(0); ccm_triggerSelectBlogUser(<userID>,'<userName.','<userEmail>'); jQuery.fn.dialog.closeTop();"

attached to the users but if I sort the user list in any way then the the function changes to

"javascript:void(0); ccm_triggerSelectUser(<userID>,'<userName.','<userEmail>'); jQuery.fn.dialog.closeTop();"

I have replaced line 16 of /packages/problog/models/attribute/types/user_picker/controller.php

but am still receiving the same issue.

concrete5 Environment Information

12.4.4

Browser User-Agent String

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.