localgovdrupal / localgov_events

Events for LocalGov Drupal.
GNU General Public License v2.0
1 stars 0 forks source link

Drupal 10 support #93

Closed stephen-cox closed 12 months ago

stephen-cox commented 1 year ago

There needs to be a major release of LocalGov Geo fro Drupal support (https://github.com/localgovdrupal/localgov_geo/issues/65#issuecomment-1447093730), which as a dependency of Events, requires a major version bump for Events.

This will require a 3.x release.

Fixes #91

finnlewis commented 1 year ago
There was 1 error:

1) Drupal\Tests\localgov_events\Functional\EventPageTest::testEventFields
Exception: Warning: Undefined array key "localgov_directories_venue"
Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem::Drupal\Core\Field\Plugin\Field\FieldType\{closure}()() (Line: 144)

I can't replicate this manually locally. I enable localgov_events, then enable localgov_directories_venue and I can see the field. Maybe I'm barking up the wrong tree?

finnlewis commented 1 year ago

Hmmm.. odd. When I comment out line 79, the test passes.

https://github.com/localgovdrupal/localgov_events/blob/feature/drupal-10/tests/src/Functional/EventPageTest.php#L79

    // Check optional provider field.
    \Drupal::service('module_installer')->install(['localgov_directories_page']);
    // $this->drupalGet('/admin/structure/types/manage/localgov_event/fields');
    // $this->assertSession()->pageTextContains('localgov_event_provider');
    // $this->assertSession()->pageTextNotContains('localgov_event_venue');

    // Check optional venue field.
    \Drupal::service('module_installer')->install(['localgov_directories_venue']);
    $this->drupalGet('/admin/structure/types/manage/localgov_event/fields');
    $this->assertSession()->pageTextContains('localgov_event_venue');

Uncommenting line 79 makes the test fail again:

    // Check optional provider field.
    \Drupal::service('module_installer')->install(['localgov_directories_page']);
    $this->drupalGet('/admin/structure/types/manage/localgov_event/fields');
    // $this->assertSession()->pageTextContains('localgov_event_provider');
    // $this->assertSession()->pageTextNotContains('localgov_event_venue');

    // Check optional venue field.
    \Drupal::service('module_installer')->install(['localgov_directories_venue']);
    $this->drupalGet('/admin/structure/types/manage/localgov_event/fields');
    $this->assertSession()->pageTextContains('localgov_event_venue');

Why is hitting the /admin/structure/types/manage/localgov_event/fields page triggering the error? Exception: Warning: Undefined array key "localgov_directories_venue"

finnlewis commented 1 year ago

Would be good to fix this test so we can release an alpha for Drupal 10 support.