When I started I had Drupal 8.1.7 installed and tried to update to 8.4.3 but a 500 error.  So I restored my site back and update to the next incremental minor Drupal security updates up to 8.3.1 where I notice things were not looking right.  My last stable update is 8.2.8 and when updating to 8.3.1 using update.php through the GUI I got a message that referenced serialization and gave me this link https://www.drupal.org/node/2837696.

I've read through this link but I don't see where this serialization.settings file is located to be backwards compatible with the old behavior.  I suspect the custom module and custom theme I inherited from the previous company is affected by this serialization change from 8.2.x to 8.3.x but I don't know php and at a high level I'm aware about hooks.  Unfortunately I don't have a lot of time to take it update it at this moment.

Where can I find this serialization.settings file in the Drupal tree?  Failing that, is DRUSH built into DRUPAL or a module I have to install? Is there another option or am I heading down the wrong path?

Thanks!

Comments

mmjvb’s picture

https://api.drupal.org/api/drupal/core%21modules%21serialization%21seria...
Shows the code that actually sets the wrong value for you:

function serialization_update_8302() {
  $config_factory = \Drupal::configFactory();
  $config_factory->getEditable('serialization.settings')
    ->set('bc_primitives_as_strings', FALSE)
    ->save(TRUE);

It is documented in Change record: https://www.drupal.org/node/2837696
but that points to: https://www.drupal.org/docs/8/api/configuration-api/configuration-overri...
which doesn't really help you. Suspect the following in settings.php might work:
$config['serialization.settings']['bc_primitives_as_strings'] = TRUE;

Although you could change the serialization service setting in the yml file, suggest to use the above code in the settings.php instead of changing code. DRUSH is a separate module that can be used when you have a cmdline available. Suggest to postpone its installation till you are finished updating Drupal due to its version incompatibility (version 8 or 9).

Markasourus’s picture

Thanks.  I'll check that out and see if it works out.

Markasourus’s picture

I changed the file in core back to the original "false" state and added your suggestion in my settings.php file both Uppercase and Lowercase values of true and got the same results.  Should I add the line into the custom module?  If so what file would it be?  Failing that, I'm suspecting that I might be going the wrong path here and another fundamental changed between 8.2.8 and 8.3.0 is affecting the custom module or the custom theme to properly display the screen.  Thanks for your help.

mmjvb’s picture

The alternative is to change serialization_update_8302 and replace FALSE with TRUE there. Unfortunately, that would need to be done for each further update. Or copy that changed code and put it in settings.php. 

Haven't looked into whether this is really the cause or not. Will do that now, can only see your last response while typing the reply. 

EDIT
Could you elaborate on the message about serialization you received? What custom module and theme are you talking about? What about other modules? What about D844?

Adding code below to settings.php should do the same as overriding
\Drupal::configFactory()
->getEditable('serialization.settings')
->set('bc_primitives_as_strings', TRUE)
->save(TRUE);

Markasourus’s picture

I think I found the file and manually made the recommended change but the page that uses custom module and theme is still not displaying properly.  Did I make the change in the correct location at "...\core\modules\serialization\config\install\serialization.settings.yml" or does manually updating the file is not the same as one of the other three prescribed methods.  I thought messing around with modules in core was not recommended so should I download the module to the ...\modules\contrib\?

mmjvb’s picture

again advice against changing core. It could be cache or that file you changed is only used upon install. Did you use lowercase true ?

Markasourus’s picture

Apparently the issue is with the Display Suite module.  There's a specific version to work with 8.3.x but wasn't listed under "Extend - Updates" but listed as "Available" under "Reports - Available Updates".  Found it here https://www.drupal.org/project/ds

I'll know better next time to check the main page of my downloaded modules instead of specific version release notes.  I did a lot of searching on Drupal forums for keywords before I managed to get to that page.  Thanks for the help.