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.) 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.
Type: | Discussion |
---|---|
Status: | In Progress |
looking into this.
C
C
Hi Evan,
The immediate fix for this is to replace line 16 of /packages/problog/models/attribute/types/user_picker/controller.php with
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
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
next update will reflect this change btw.
C
C
Cool, thx!
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.
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
ChadStrat
Not seeing any JS issue in the developer console. As this is a dashboard page, the only JS loaded is ProBlog and core.
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
ChadStrat
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.
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.
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
C
The site is 5.6.3.2
ProBlog is 12.4.4
ProBlog is 12.4.4
you could try uncommenting line 15 of that attribute controller in ProBlog. perhaps you're just missing that js???? dunno.
ChadStrat
ChadStrat
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
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?
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?
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
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
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
Line 553 sets the blog author attribute as a user picker
Dashboard add blog view, line 86
User picker attribute model, line 16:
So the problog version of the user selector is being loaded with the ccm_triggerSelectBlogUser() sript called on user selection.
Package controller v12.4.4, line 541, installs a user picker attribute type from problog
Line 553 sets the blog author attribute as a user picker
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.
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?
ChadStrat
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
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.
- 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.
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.
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.
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