localgovdrupal / localgov_project

Project template for Drupal 10 sites built with the LocalGov Drupal distribution.
https://localgovdrupal.org
GNU General Public License v2.0
10 stars 8 forks source link

Undefined property: stdClass::$postal_address_address_line3 #158

Closed finnlewis closed 3 months ago

finnlewis commented 4 months ago

We recently update localgov_paragraphs to allow drupal/address to update to the 2.x branch

https://github.com/localgovdrupal/localgov_paragraphs/commit/d46563cc36c0e7b20b387c4372c6baa5f7edc511

It looks like this has caused an error in our LocalGovUpdateTest:

1) Drupal\Tests\localgov\Functional\LocalGovUpdateTest::testUpdate
Exception: Warning: Undefined property: stdClass::$postal_address_address_line3
Drupal\Core\Entity\Sql\SqlContentEntityStorage->loadFromDedicatedTables()() (Line: 1269)

See https://github.com/localgovdrupal/localgov_project/actions/runs/8733807241/job/23963250485#step:5:20

Any ideas @ekes / @stephen-cox ?

ekes commented 4 months ago

Address 2.x adds a address_line3. The upgrade from 1.x to 2.x had a db update, run it lots of times without any issue. https://git.drupalcode.org/project/address/-/commit/ae13df2cb62d2a1b4292f7637dd3627cf7574b81

It doesn't as far as I'm aware require 1.x to be updated to a particular version.

So I can only guess it's not running the updates in the same order? It's failing on UpdatePathTestBase?

/var/www/html/web/core/tests/Drupal/Tests/UpdatePathTestTrait.php:55
/var/www/html/web/core/tests/Drupal/FunctionalTests/Update/UpdatePathTestBase.php:204
/var/www/html/web/profiles/contrib/localgov/tests/src/Functional/LocalGovUpdateTest.php:82
/var/www/html/vendor/phpunit/phpunit/src/Framework/TestResult.php:729
stephen-cox commented 3 months ago

I've found the issue. The Address update needs to run before the LocalGov Geo Update updates.

This can be fixed with a hook_update_dependencies hook.

stephen-cox commented 3 months ago

Fix for this here https://github.com/localgovdrupal/localgov_geo/pull/116