Closed sandrodz closed 7 years ago
Check your browser console for possible js errors that may be causing conflicts. Also PHP errors could be playing a part in preventing returned results from AJAX
@tw2113 there are no errors in console. Returned data is simply empty:
@tw2113 debugged it, problem is that meta_query key _user_level doesn't use table prefix, its hardcoded.
I'm looking at a pretty stock WP install for my local dev and wp_user_level
is what WordPress core uses for the meta key for user levels. That's not a custom key that CMB2 set, for example.
However, if you had changed that in the past somehow, then that would be a contributing factor.
@tw2113 WordPress changes key name based on table prefix. So key should use prefix.
ahhh. Good point.
With that said, so that you're not editing the plugin directly, you could use the filter right below it to safely modify the key to fetch.
$user_args = apply_filters( 'wds_cmb2_user_select_search_args', $user_args, $this );
I think simpler/cleaner solution would be to make plugin compatible with WordPress option of changing table name prefix. Security conscience users will bump into this. Using filter is not an option, I randomly generate table prefixes on new install.
This could be a simple fix:
@tw2113 I can do PR if you'd like.
Just saying that it's technically possible to do it via the filter already provided. That said, PR it up, and we'll take it in.
The user level thing needs to go away entirely. #3 is on the right path.
yep #3 looks great. Why was not it merged?
because it slipped through the cracks and no one had taken care of it yet.
Is there an ETA for that PR? I looked through the code, nothing particularly problematic jumps out. But I could be wrong.
Whenever someone gets around to it, to be honest. I'd appreciate some testing just in case, for what it's worth.
Merged
Readme needs to be updated as well.
Can you please also release a new version?
Good catch on the readme, that has been updated. Bumped/tagged.
I can see new input, but search/autocomplete list never comes up.