- Merge request !1474Issue #3110831: Cannot un-disable a resource type field disabled by a previous ResourceTypeBuildEvent subscriber β (Open) created by bbrala
- πΊπΈUnited States smustgrave
This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request β as a guide.
Verified the test coverage running locally without the fix. I got
Error : Call to undefined method Drupal\jsonapi\ResourceType\ResourceTypeBuildEvent::enableField()
Which is good!
All threads are resolved on the MR
All tests are green
Change record is added and make sense (to me at least)
New functions are typehintedThis looks good to me.
- Status changed to Needs review
over 1 year ago 12:31am 19 March 2023 - π¬π§United Kingdom alexpott πͺπΊπ
There are several other options here. You could alter the service that subscribes the event or you could implement an event subscriber with a higher priority and stop propagation. I'm not sure that adding
enableField()
to fight it out withdisableField()
is going to improve the situation. I can imagine people adding an event to disable a field, that was disabled and then enabled. Feels odd. - Status changed to Needs work
over 1 year ago 3:20am 1 April 2023 - πΊπΈUnited States smustgrave
Alright issue should be reworked based on #22 or explained why this is the better approach.
Decision should be documented in issue summary please
Thanks.
- πΊπΈUnited States matthand Riverdale Park, Maryland
Is there a way to re-enable the UUID field that is disabled on node resources by JSON:API without this new enableField method? I don't think so. Real world scenario of trying to match a legacy Drupal 8 JSON:API endpoint to prevent consumer apps requiring a rebuild.
- πΊπΈUnited States z3cka
I agree that this can probably be handled better, but until a better solution is provided, I went ahead and rebased the temp fix on to the Drupal
10.3.x
branch for those that need a compatible patch. - π³π±Netherlands bbrala Netherlands
I really think this is the way, it might need some priority juggling to make work in your application but that should be fine. I'll update the MR to 11.x and make sure codestyle and everything is up to date.
- Status changed to Needs review
5 months ago 9:15am 19 July 2024 - π³π±Netherlands bbrala Netherlands
Moved all changed to 11.x, also updates a return type that didnt make sense. I think this is good like this. I've updated the issue summary also.
I still think this is the best option for adjusting, even though this could mean you enable and disable multiple times. But i don't think this will be an actually issue in implementations.
- Status changed to RTBC
5 months ago 4:58pm 29 July 2024 - πΊπΈUnited States smustgrave
Reading the CR and it appears to contain good detail with a nice example
Test-only feature has already been ran
1) Drupal\Tests\jsonapi\Kernel\ResourceType\ResourceTypeRepositoryTest::testResourceTypeFieldEnabling Error: Call to undefined method Drupal\jsonapi\ResourceType\ResourceTypeBuildEvent::enableField() /builds/issue/drupal-3110831/core/modules/jsonapi/tests/modules/jsonapi_test_resource_type_building/src/EventSubscriber/LateResourceTypeBuildEventSubscriber.php:41 /builds/issue/drupal-3110831/vendor/symfony/event-dispatcher/EventDispatcher.php:206 /builds/issue/drupal-3110831/vendor/symfony/event-dispatcher/EventDispatcher.php:56 /builds/issue/drupal-3110831/core/modules/jsonapi/src/ResourceType/ResourceTypeRepository.php:165 /builds/issue/drupal-3110831/core/modules/jsonapi/src/ResourceType/ResourceTypeRepository.php:132 /builds/issue/drupal-3110831/core/modules/jsonapi/src/ResourceType/ResourceTypeRepository.php:131 /builds/issue/drupal-3110831/core/modules/jsonapi/src/ResourceType/ResourceTypeRepository.php:209 /builds/issue/drupal-3110831/core/modules/jsonapi/tests/src/Kernel/ResourceType/ResourceTypeRepositoryTest.php:246 ERRORS! Tests: 13, Assertions: 192, Errors: 1.
So coverage is there.
Added some super nitpicky :void returns directly.
Believe all feedback has been addressed.
-
longwave β
committed 257fb3b3 on 10.4.x
Issue #3110831 by bbrala, z3cka, smustgrave, mglaman, wim leers,...
-
longwave β
committed 257fb3b3 on 10.4.x
-
longwave β
committed a1c6ae78 on 11.x
Issue #3110831 by bbrala, z3cka, smustgrave, mglaman, wim leers,...
-
longwave β
committed a1c6ae78 on 11.x
- π¬π§United Kingdom longwave UK
Committed to 11.x for 11.1.0 and backported to 10.4.x as a minor API addition to keep things in sync. Also published the change record.
Committed and pushed a1c6ae78c3 to 11.x and 257fb3b34b to 10.4.x. Thanks!
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Nice, one more thing in #3032787: [META] Start creating the public PHP API of the JSON:API module β that ships! π₯³
- Status changed to Fixed
2 months ago 1:19pm 11 October 2024 Automatically closed - issue fixed for 2 weeks with no activity.