Roles not showing
-
Hi Tom,
Me again. ??
In the settings section, I cannot see any role in the dropdown menu when I try to map external roles to WP ones.
What do I do wrong?Thanks
Rene
-
Hmmm never heard that one before. If you could check your browsers console for errors that’s be much appreciated.
I’ll try and see if I can replicate one evening. Can you confirm the versions of PHP, External Login and WordPress that you are using.
Thanks,
Tom
External Login:1.11.0
PHP: 7.4.3
Wordpress: 5.5.3Here is the console:
options_condtionals.js?ver=e0e0cc41f5f63c4d22c0b4c6b1f6119c:17External Login ERROR:
Invalid JSON in conditional string. Data:
<br />
<b>Notice</b>: Undefined index: conditionals in <b>/var/www/wordpress/wp-content/plugins/external-login/views/form_elements/checkbox_field.php</b> on line <b>3</b><br />
null
options_condtionals.js?ver=e0e0cc41f5f63c4d22c0b4c6b1f6119c:17External Login ERROR:
Invalid JSON in conditional string. Data:
<br />
<b>Notice</b>: Undefined index: conditionals in <b>/var/www/wordpress/wp-content/plugins/external-login/views/form_elements/checkbox_field.php</b> on line <b>3</b><br />
null
options_condtionals.js?ver=e0e0cc41f5f63c4d22c0b4c6b1f6119c:17External Login ERROR:
Invalid JSON in conditional string. Data:
<br />
<b>Notice</b>: Undefined index: conditionals in <b>/var/www/wordpress/wp-content/plugins/external-login/views/form_elements/select_field.php</b> on line <b>3</b><br />
null
options_condtionals.js?ver=e0e0cc41f5f63c4d22c0b4c6b1f6119c:17External Login ERROR:
Invalid JSON in conditional string. Data:
<br />
<b>Notice</b>: Undefined index: conditionals in <b>/var/www/wordpress/wp-content/plugins/external-login/views/form_elements/checkbox_field.php</b> on line <b>3</b><br />
null
options_condtionals.js?ver=e0e0cc41f5f63c4d22c0b4c6b1f6119c:17External Login ERROR:
Invalid JSON in conditional string. Data:
<br />
<b>Notice</b>: Undefined index: conditionals in <b>/var/www/wordpress/wp-content/plugins/external-login/views/form_elements/text_field.php</b> on line <b>3</b><br />
null
options_condtionals.js?ver=e0e0cc41f5f63c4d22c0b4c6b1f6119c:17External Login ERROR:
Invalid JSON in conditional string. Data:
<br />
<b>Notice</b>: Undefined index: conditionals in <b>/var/www/wordpress/wp-content/plugins/external-login/views/form_elements/text_field.php</b> on line <b>3</b><br />
null
options_condtionals.js?ver=e0e0cc41f5f63c4d22c0b4c6b1f6119c:17External Login ERROR:
Invalid JSON in conditional string. Data:
<br />
<b>Notice</b>: Undefined index: conditionals in <b>/var/www/wordpress/wp-content/plugins/external-login/views/form_elements/text_field.php</b> on line <b>3</b><br />
null
options_condtionals.js?ver=e0e0cc41f5f63c4d22c0b4c6b1f6119c:17External Login ERROR:
Invalid JSON in conditional string. Data:
<br />
<b>Notice</b>: Undefined index: conditionals in <b>/var/www/wordpress/wp-content/plugins/external-login/views/form_elements/text_field.php</b> on line <b>3</b><br />
null
options_condtionals.js?ver=e0e0cc41f5f63c4d22c0b4c6b1f6119c:17External Login ERROR:
Invalid JSON in conditional string. Data:
<br />
<b>Notice</b>: Undefined index: conditionals in <b>/var/www/wordpress/wp-content/plugins/external-login/views/form_elements/text_field.php</b> on line <b>3</b><br />
null
options_condtionals.js?ver=e0e0cc41f5f63c4d22c0b4c6b1f6119c:17External Login ERROR:
Invalid JSON in conditional string. Data:
<br />
<b>Notice</b>: Undefined index: conditionals in <b>/var/www/wordpress/wp-content/plugins/external-login/views/form_elements/select_field.php</b> on line <b>3</b><br />
null
options_condtionals.js?ver=e0e0cc41f5f63c4d22c0b4c6b1f6119c:17External Login ERROR:
Invalid JSON in conditional string. Data:
<br />
<b>Notice</b>: Undefined index: conditionals in <b>/var/www/wordpress/wp-content/plugins/external-login/views/form_elements/select_field.php</b> on line <b>3</b><br />
null
options_condtionals.js?ver=e0e0cc41f5f63c4d22c0b4c6b1f6119c:17External Login ERROR:
Invalid JSON in conditional string. Data:
<br />
<b>Notice</b>: Undefined index: conditionals in <b>/var/www/wordpress/wp-content/plugins/external-login/views/form_elements/text_field.php</b> on line <b>3</b><br />
null
options_condtionals.js?ver=e0e0cc41f5f63c4d22c0b4c6b1f6119c:17External Login ERROR:
Invalid JSON in conditional string. Data:
<br />
<b>Notice</b>: Undefined index: conditionals in <b>/var/www/wordpress/wp-content/plugins/external-login/views/form_elements/text_field.php</b> on line <b>3</b><br />
null
options_condtionals.js?ver=e0e0cc41f5f63c4d22c0b4c6b1f6119c:17External Login ERROR:
Invalid JSON in conditional string. Data:
<br />
<b>Notice</b>: Undefined index: conditionals in <b>/var/www/wordpress/wp-content/plugins/external-login/views/form_elements/text_field.php</b> on line <b>3</b><br />
null
options_condtionals.js?ver=e0e0cc41f5f63c4d22c0b4c6b1f6119c:17External Login ERROR:
Invalid JSON in conditional string. Data:
<br />
<b>Notice</b>: Undefined index: conditionals in <b>/var/www/wordpress/wp-content/plugins/external-login/views/form_elements/text_field.php</b> on line <b>3</b><br />
null
options_condtionals.js?ver=e0e0cc41f5f63c4d22c0b4c6b1f6119c:17External Login ERROR:
Invalid JSON in conditional string. Data:
<br />
<b>Notice</b>: Undefined index: conditionals in <b>/var/www/wordpress/wp-content/plugins/external-login/views/form_elements/text_field.php</b> on line <b>3</b><br />
null
options_condtionals.js?ver=e0e0cc41f5f63c4d22c0b4c6b1f6119c:17External Login ERROR:
Invalid JSON in conditional string. Data:
<br />
<b>Notice</b>: Undefined index: conditionals in <b>/var/www/wordpress/wp-content/plugins/external-login/views/form_elements/text_field.php</b> on line <b>3</b><br />
null
options_condtionals.js?ver=e0e0cc41f5f63c4d22c0b4c6b1f6119c:17External Login ERROR:
Invalid JSON in conditional string. Data:
<br />
<b>Notice</b>: Undefined index: conditionals in <b>/var/www/wordpress/wp-content/plugins/external-login/views/form_elements/text_field.php</b> on line <b>3</b><br />
null
options_condtionals.js?ver=e0e0cc41f5f63c4d22c0b4c6b1f6119c:17External Login ERROR:
Invalid JSON in conditional string. Data:
<br />
<b>Notice</b>: Undefined index: conditionals in <b>/var/www/wordpress/wp-content/plugins/external-login/views/form_elements/checkbox_field.php</b> on line <b>3</b><br />
null
options_condtionals.js?ver=e0e0cc41f5f63c4d22c0b4c6b1f6119c:17External Login ERROR:
Invalid JSON in conditional string. Data:
<br />
<b>Notice</b>: Undefined index: conditionals in <b>/var/www/wordpress/wp-content/plugins/external-login/views/form_elements/select_field.php</b> on line <b>3</b><br />
null
options_condtionals.js?ver=e0e0cc41f5f63c4d22c0b4c6b1f6119c:17External Login ERROR:
Invalid JSON in conditional string. Data:
<br />
<b>Notice</b>: Undefined index: conditionals in <b>/var/www/wordpress/wp-content/plugins/external-login/views/form_elements/checkbox_field.php</b> on line <b>3</b><br />
null
options_condtionals.js?ver=e0e0cc41f5f63c4d22c0b4c6b1f6119c:17External Login ERROR:
Invalid JSON in conditional string. Data:
<br />
<b>Notice</b>: Undefined index: conditionals in <b>/var/www/wordpress/wp-content/plugins/external-login/views/form_elements/text_field.php</b> on line <b>3</b><br />
null
options_condtionals.js?ver=e0e0cc41f5f63c4d22c0b4c6b1f6119c:17External Login ERROR:
Invalid JSON in conditional string. Data:
<br />
<b>Notice</b>: Undefined index: conditionals in <b>/var/www/wordpress/wp-content/plugins/external-login/views/form_elements/repeater_field.php</b> on line <b>8</b><br />
null
options_condtionals.js?ver=e0e0cc41f5f63c4d22c0b4c6b1f6119c:17External Login ERROR:
Invalid JSON in conditional string. Data:
<br />
<b>Notice</b>: Undefined index: conditionals in <b>/var/www/wordpress/wp-content/plugins/external-login/views/form_elements/text_field.php</b> on line <b>3</b><br />
null
exlog_repeater_field_handler.js?ver=e0e0cc41f5f63c4d22c0b4c6b1f6119c:242 EXLOG: Error storing repeater data for ‘exlog_exclude_users_field_value_repeater’ Value: false
exlog_repeater_field_handler.js?ver=e0e0cc41f5f63c4d22c0b4c6b1f6119c:242 EXLOG: Error storing repeater data for ‘exlog_exclude_users_field_value_repeater’ Value: false
jquery-migrate-3.0.0.min.js:2 JQMIGRATE: Migrate is installed, version 3.0.0
content.js:529 launching FocusManager.parse_for_input on DOM mutation event
content.js:529 launching FocusManager.parse_for_input on DOM mutation event
close.png:1 Failed to load resource: the server responded with a status of 404 ()
kb_bg.png:1 Failed to load resource: the server responded with a status of 404 ()This is really useful thanks ??
Will endeavour to have a good look at this by the end of the weekend.
Thanks for your support and patience ??
Hi Tom,
Did you get a chance to figure out what was going on?
Thanks
ReneHey @ketr64,
Sincere apologies for not getting back to you at the weekend. I only found about 20 minutes of time over the weekend to look at this. I’m going to have a little look now so no update just yet but just wanted you to know I haven’t forgotten about you.
Thanks for your patience,
Tom
Hey Rene,
So the issue we have is I can’t replicate it. This would be so much easier if we could screen share but unfortunately that is not allowed ??
I’m going to tell you my thought process and describe what I think we can do next to resolve these issues.
Firstly, I wonder if you have some corrupt data in your database for some reason.
My first suggestion would be to go to your
wp_options
table and delete the option with nameexlog_roles_custom_fields
. Then go back to the admin area and see if you get the data you hope to see.The second thought I have is to just double check that you have got data in the
wp_options
table for the option namewp_user_roles
. This is where WP stores the roles and I would have expected to see some standard ones in here at a minimum.The third thought – and I know it’s a pain when a developer suggests this – but can you disable other plugins and use the default theme just to make sure it’s not a side effect of another plugin / theme.
My next thought is regarding the errors you have specified above. I don’t believe that any of these would cause the issue you are describing however I have made some changes locally that should prevent those warning from appearing unnecessarily. I don’t know how comfortable you are technically but I was considering putting this, and an additional code change that would add more logging, into a branch on Github. If I gave you a link, would you be comfortable downloading the ZIP file, and extracting the files out of the
plugin-files
directory within and placing them over the top of your current files on a local or staging site.We could then see if a) The tiny checks I put in resolved your problem (I think unlikely) or b) you can re-load the page and give me information of additional logs to help diagnose where the issue could be.
Let me know your thoughts. These things are always so much easier if I can replicate but I’ve got the same PHP, WordPress and plugin versions installed as you have specified and it’s not bloody breaking! How annoying ??
Thanks for your patience Rene,
Tom
Hi Tom,
So I started looking into your recommendations.
– wp_options/exlog_roles_custom_fields table: I had 1 row in there with following content:
+———–+—————————+————–+———-+
| option_id | option_name | option_value | autoload |
+———–+—————————+————–+———-+
| 75326 | exlog_roles_custom_fields | [] | yes |
+———–+—————————+————–+———-+
I deleted it and went back to the settings page but still the same.
– wp_options/wp_user_roles: there is only one row there. I could send you an email with the content if you want.
– deactivating plugins: I started with one that is related to roles but it is still the same. The plugin name is ‘User role editor’.
– I forgot to mention that the drop down list for the default role is not empty. I would have expected that this list is the same as the one for the mapping
– Can you please tell me which query/process you make to get this mapping drop down list? I can try to debug
– for the unzipping/installing I am OK with that. I do it pretty often
Best
ReneHey @ketr64,
Thanks for this. Really interesting that it’s working in the above dropdown. Just to confirm, the ‘Unspecified roles’ setting is populating correctly however the drop downs in role mappings are not?
I wish I could contact you outside of the plugin so we could hop on a call together and debug this in no time but unfortunately I’m not allowed to give my contact details / contact you outside here as it breaks the www.ads-software.com rules ??
In regard to which files to look into for this bug:
This file builds all of the mappings:
/views/form_elements/roles_fields_builder.php
This file is the input field, drop down and delete button – used by the above file:
/views/form_elements/role_field.php
The
exlog_get_wp_role_types
method (found here:plugin-files/tools/get_roles.php
) is the one that grabs the WordPress roles. Here’s the function for quick reference:function exlog_get_wp_role_types() { global $wp_roles; if ( ! isset( $wp_roles ) ) $wp_roles = new WP_Roles(); return array_reverse($wp_roles->get_names()); }
I’ve started debugging further but have run out of time this morning.
Will hopefully send you instructions later on how to get hold of my debugging version ??
Thanks Rene,
Tom
Hey Rene,
I’ve added a couple of commits that remove some warnings and add some additional logs.
Before you send me any logs -please make sure there is no personal information within.
Here’s the steps that you’ll need to take to test this:
1) Go here.
2) Click the green code button
3) Click Download Zip
4) Extract the zip on your computer
5) Copy the directory calledplugin-files
in the extracted folder.
6) Replace theplugin-files
directory with the same named directory in your version of the plugin on your test environment
7) Test to see if you experience anything different
8) Send me the logs (ensuring there is nothing that should not be made public) back here.Thanks Rene,
Tom
Hi Tom. I get a 404 page when I click on the ‘here’ link above.
Try again now ??
It works!! I am going to set it up now. Thanks.
AWESOME!!!
I’ve made loads of debugging statements in there so will have to tidy up before a release.
So glad we got it working for you. Sorry it’s taken so long – I appreciate your patience. Just so hard to resolve when I’m not sitting at your machine ??
Certainly won’t mark this as resolved until you’ve tested, ensured you’re happy and then I’ve deployed it to the actual plugin.
Looking forward to hearing how your further testing goes ??
Tom, where can I find the logs I need to send you?
I can now do mappings but there are error messages:
<\/select>\nNotice<\/b>: Undefined variable: exlog_external_role in \/var\/www\/wordpress\/wp-content\/plugins\/external-login\/views\/form_elements\/role_field.php<\/b> on line 10<\/b>
\n
\nNotice<\/b>: Trying to access array offset on value of type null in \/var\/www\/wordpress\/wp-content\/plugins\/external-login\/views\/form_elements\/role_field.php<\/b> on line 10<\/b>
\n”,”external_role_name”:”exlog_role_external_”},{“external_role_value”:”INSIDER_RECIP”,”wordpress_role_value”:”insider_recip”,”wordpress_role_name”:”exlog_role_wordpress_”,”external_role_name”:”exlog_role_external_”},{“external_role_value”:”RECIPIENT”,”wordpress_role_value”:”recipient”,”wordpress_role_name”:”exlog_role_wordpress_”,”external_role_name”:”exlog_role_external_”},{“external_role_value”:”ACCOUNT”,”wordpress_role_value”:”account”,”wordpress_role_name”:”exlog_role_wordpress_”,”external_role_name”:”exlog_role_external_”}]” />I’m working my day job at the moment but will try my best to get back to you this evening ??
Thanks for sending an update. ??
- The topic ‘Roles not showing’ is closed to new replies.