- πΊπΈUnited States justcaldwell Austin, Texas
I installed 1.0.x-dev on Drupal 10 and applied the bot patch from #2. A
drush en micronode
failed with:PHP Fatal error: Declaration of Drupal\micronode\Routing\MicronodeRouteSubscriber::getSubscribedEvents() must be compatible with Drupal\Core\Routing\RouteSubscriberBase::getSubscribedEvents(): array in /var/www/docroot/modules/contrib/micronode/src/Routing/MicronodeRouteSubscriber.php on line 79
Looks like MicronodeRouteSubscriber::getSubscribedEvents() needs a return type for starters.
- @justcaldwell opened merge request.
- πΊπΈUnited States justcaldwell Austin, Texas
Okay, finally set up testing in my D10 env. After updating the core_version_requirement to ^9 || ^10 for the views test module, I'm still getting:
There was 1 error: 1) Drupal\Tests\micronode\Functional\MicronodeFunctionalTest::testMicroContentAddPages Behat\Mink\Exception\ElementTextException: The text "Add Micro-content" was not found in the text of the element matching css "h1".
Sure enough, when I replicate the test manually, I get Access Denied when I visit /node/add-microcontent:
On a Drupal 9 install, I get the expected result:
- πΊπΈUnited States justcaldwell Austin, Texas
Ah, the culprit is _node_add_access access check deprecated in favor of _entity_create_access/_entity_create_any_access β .
Updating the route to
'_entity_create_any_access' => 'node',
does the trick. That'll require bumping the minimum for Drupal 9 to 9.3. - Status changed to Needs review
almost 2 years ago 5:18pm 23 February 2023 - πΊπΈUnited States justcaldwell Austin, Texas
Tests are green, and everything looks good in my manual testing in both D9 and D10. Please review. Thanks!
- Status changed to Needs work
almost 2 years ago 8:35pm 7 March 2023 - πΊπΈUnited States danflanagan8 St. Louis, US
Looking good, @justcaldwell
The deprecation you addressed in #7 was a good find. The bot didn't even find it!
I'm still seeing this notice when I run the tests locally
2x: The Drupal\Tests\micronode\Functional\MicronodeFunctionalTest::$modules property must be declared protected. See https://www.drupal.org/node/2909426 2x in DrupalListener::startTest from Drupal\Tests\Listeners
I think we should fix that.
And if we're making that change, I think we should bring the type hinting style into line with what I see everywhere is core. There should be a single space between the colon and the hint. For example,
public function setUp(): void {
- πΊπΈUnited States justcaldwell Austin, Texas
Thanks for the review @danflanagan8!
I made those changes, but the test added in π micronode_get_node_types caches result incorrectly Fixed is failing on D10. Runs fine for me locally. The rebase seems to have worked just fin. Scratching my head over here.
- πΊπΈUnited States danflanagan8 St. Louis, US
Hi @justcaldwell
I wrote that failing test so I'm in a good position to know how to fix it! :)
The failure is:
1) Drupal\Tests\micronode\Functional\MicronodeFunctionalTest::testMicroContentAddPages Failed asserting that two arrays are identical. --- Expected +++ Actual @@ @@ Array &0 ( - 0 => 'one' - 1 => 'three' - 2 => 'two' + 0 => 'two' + 1 => 'one' + 2 => 'three' )
Looks like I was too lazy when I wrote that assertion. Or more confident than I should have been.
We should be able to change the
assertSame()
to use the looser assertionassertEqualsCanonicalizing
. This method considers two arrays to be equal as long as they have all the same elements, regardless of order. We don't care about the order, soassertEqualsCanonicalizing
will not change the spirit of the test. - Status changed to Needs review
almost 2 years ago 6:34pm 13 March 2023 - πΊπΈUnited States danflanagan8 St. Louis, US
I made the change I suggested in #11 and triggered tests. Let's see if they pass!
- πΊπΈUnited States justcaldwell Austin, Texas
All π’ π. Thanks, Dan!
- Status changed to RTBC
almost 2 years ago 6:52pm 13 March 2023 - πΊπΈUnited States danflanagan8 St. Louis, US
Sweet! If this were core I shouldn't RTBC, but all I did was fix a test I should have written better in a recent issue. All the D10 work here was done by @justcaldwell and looks very nice. I'll be bold and flip the switch.
Cheers!
- First commit to issue fork.
-
marcoscano β
committed 27818078 on 1.0.x authored by
justcaldwell β
Issue #3288603 by justcaldwell, danflanagan8, Project Update Bot,...
-
marcoscano β
committed 27818078 on 1.0.x authored by
justcaldwell β
- Status changed to Fixed
almost 2 years ago 1:16pm 15 March 2023 - πͺπΈSpain marcoscano Barcelona, Spain
Thank you all for contributing!
Code looks good to me, committed and tagged 1.1.0 β for this. Also adjusted automated testing to default to D10 now. \o/
Thanks again! Automatically closed - issue fixed for 2 weeks with no activity.