Problem/Motivation

The way in which core/modules/system/tests/fixtures/update/drupal-8.8.0.bare.standard.php.gz and core/modules/system/tests/fixtures/update/drupal-8.8.0.filled.standard.php.gz were built has resulted in core.extension:profile being NULL.

This happened because these databases were created by importing the 8-rc1 equivalents on the 8.8.0 codebase and then running updates. This meant that nothing wrote a value for the install profile to settings.php and therefore system_update_8601() couldn't set the profile.

There aren't really any bad impacts from this other than we're not the scanning install profile's directory for stuff.

Proposed resolution

Fix the dumps so this value is set and add an assertion to \Drupal\FunctionalTests\Update\UpdatePathTestBaseTest::testDatabaseLoaded() so that we can ensure it is set correctly.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

N/a

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Status: Active » Needs review
StatusFileSize
new4.65 KB

Here's a test only patch.

alexpott’s picture

StatusFileSize
new1.12 MB

Here's a fix. No interdiff because it is compressed files.

I ran the dump scripts on an empty db and then ran the following script:

use Drupal\Core\Database\Database;

$connection = Database::getConnection();
$extensions = $connection->select('config')
  ->fields('config', ['data'])
  ->condition('collection', '')
  ->condition('name', 'core.extension')
  ->execute()
  ->fetchField();
$extensions = unserialize($extensions);
$extensions['profile'] = 'standard';
$connection->update('config')
  ->fields([
    'data' => serialize($extensions),
  ])
  ->condition('collection', '')
  ->condition('name', 'core.extension')
  ->execute();

And then dumped the db again and recompressed it.

The last submitted patch, 2: 3109433-2.patch, failed testing. View results

alexpott’s picture

StatusFileSize
new767 bytes
new1.12 MB

Whoops some cruft crept in the patch.

berdir’s picture

Status: Needs review » Reviewed & tested by the community

Looks good now to me. I didn't diff the unzipped dumps, but I think that @alexpott has easier ways to sneak something into core if he'd really wanted to :)

The last submitted patch, 5: 3109433-5.test-only.patch, failed testing. View results

  • catch committed f791e76 on 9.0.x
    Issue #3109433 by alexpott, Berdir: Set install profile correctly in the...

  • catch committed 3897b67 on 8.9.x
    Issue #3109433 by alexpott, Berdir: Set install profile correctly in the...

  • catch committed b0cbee9 on 8.8.x
    Issue #3109433 by alexpott, Berdir: Set install profile correctly in the...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed f791e76 and pushed to 9.0.x. Thanks! Also cherry-picked to 8.9.x and 8.8.x.

catch’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.