Lỗi json_decode expects parameter 1 to be string năm 2024

Describe the bug When use HasSettingsField, I got error as below:

json_decode() expects parameter 1 to be string, array given Illuminate\Foundation\Bootstrap\HandleExceptions::handleError vendor/glorand/laravel-model-settings/src/Traits/HasSettingsField.php:64

To Reproduce Steps to reproduce the behavior:

  1. add HasSettingsField trait to user model
  2. try to get setting by: $user->settings()->get('locale')
  3. error appear

Expected behavior because trait expect to get string from database, but database return array instead

Screenshots

Been playing with your module and trying to add clientside validation to the user registration form like so: function customizations_form_alter(&$form, &$form_state, $form_id) { switch($form_id) { case 'user_register': // add clientside validation $form['mail'][' # rules'] = array( 'email' ); $form['pass'][' # rules'] = array( array( 'rule' => 'regexp[/^[a-zA-Z0-9]{6,}$/]', 'error' => 'test' ) ); break; }

But whenever I try adding a regexp rule, no matter what the regex is it throws an error; warning: json_decode() expects parameter 1 to be string, array given in clientside_validation.module on line 120. warning: Invalid argument supplied for foreach() in clientside_validation.module on line 123

What am I doing wrong? Or is this a bug?

Cheers, Bartezz

PS. I've already applied the patch commas_in_regex-1425268-3.patch from the fapi_validation issue queue to solve issues with commas in regexes...

We are doing fine. Apology for the inconvenience. Please share your administrator access here to check the issue. Use the Hidden Content box to share the credentials. Make sure that you have a full site backup with you before sharing.

Best regards

Hi there! I added the credentials in the hidden content! Thanks you!!

It looks okay now. You have changed the template.

Hi Ofi, Sorry. I've installed another template just to test if it works. But I want to do the development of this site with Wimble. When I activate Wimble, the shows the error mentioned. I've seted the Wimble template as default now, so you can test

Apology for the inconvenience. Your issue is fixed now. Please check your site.

with Casiopea template it works ok

The article issue is solved. Please check it.

Hi Ofi Khan! Thanks! the article works great now! But in home, the links of carrousel still not working (I've checked by web inspector and the a href tag are there)

Is something missconfigured? or in conflict with other component?

Thanks for your help!

Please share a screenshot of links of carrousel still not working issue to understand it better. Take a screenshot and share via any platform. For example: Lightshot

Hi Ofi Khan! I found the issue on the home. Was a CSS . Thanks a lot!

You are welcome 😊

Please accept the answer that helped you. It will be then easier to find the solution for the other users with the same issue. There is a button to accept answer after each comment.

I have a humble request. It would be very kind of you if you can manage some moment to give us feedback on

I am a complete newbie at this. I have published my quite basic website but there are 2 error codes at the top of each page of the website. How do I fix this error / hide the error message from the published / live site please?

Warning : json_decode() expects parameter 1 to be string, array given in /home/wavese5/public_html/wp-content/themes/crio/inc/boldgrid-theme-framework/includes/class-boldgrid-framework-api.php on line 944

Warning : Invalid argument supplied for foreach() in /home/wavese5/public_html/wp-content/themes/crio/inc/boldgrid-theme-framework/includes/class-boldgrid-framework-api.php on line 948

Many thanks

April 7, 2021 at 10:56 am

Hi Daniel-

Thanks for reaching out, and thanks for using the Crio WordPress Theme. I’m sorry to hear about the errors being displayed on your live site.

I’m currently working with the developers to find out how to resolve the actual error, but in the meantime you should disable Debug Display on your website.

To do this, you’ll need to edit your wp-config.php file. You can use your web host’s file manager in cPanel or FTP. Once you’re editing the file, locate the following line:

/ That's all, stop editing! Happy publishing. /

Just above that line, paste this line:

define( 'WP_DEBUG_DISPLAY', false );

I’ll post another update here in this forum topic once we’ve discovered the cause of the warning itself.

April 7, 2021 at 11:46 am

Hi Daniel-

I wanted to update you with a possible way to fix this issue that our developers have identified.

The error seems to indicate that something didn’t save correctly in your header layout. Navigate to Customize > Design > Header > Layout, and click on Delete Saved Settings under the Column Widths section, and then click Publish:

Chủ đề