- Issue created by @mcgovernm
- Merge request !10999Cleaning up Taxonomy hooks and updating baseline. β (Open) created by Unnamed author
- πΊπΈUnited States nicxvan
@oily, please make sure when you're editing the issue summary you're reviewing what is actually needed, there are definitely remaining tasks for this issue, they are just not added yet.
- πΊπΈUnited States nicxvan
@mcgovernm this is a great first step!
I think there are a couple of things we want to do in these that we wouldn't normally do for organization since they are hooks.
1. Add the appropriate return types for the methods if they do not exist.
2. Add dependency injection.These are autowired, in case you are not familiar with in general it means you should be able to just add a use statement for the interface of the service you need, then add that service to the constructor.
Let me know if you have any questions!
I'll take a deeper look later.
- π¬π§United Kingdom oily Greater London
@nicxvan wrt #5
@oily, please make sure when you're editing the issue summary you're reviewing what is actually needed, there are definitely remaining tasks for this issue, they are just not added yet.
I did not edit 'Remaining tasks'. It is blank. If you are referring to the other fields, I filled them based on what I thought appropriate. 'None' could be thought of as 'None' ever or 'None' just now.
- πΊπΈUnited States nicxvan
You did add none to remaining tasks, I removed it in comment 5.
You did the same in this issue here too: π Drupal\Core\Theme\ComponentNegotiator::negotiate uses a lot of memory Active
I agree keeping issue summaries up to date is useful, I'm not trying to discourage you from updating them.
I am trying to encourage you to review the actual issue and provide relevant updates.
There are remaining tasks both in this issue and the other, no need to write them or if you don't know what they are, but none is not accurate.
- π¬π§United Kingdom oily Greater London
@nicxvan RE: #10 I did not realise you had had to redo. I dont want to create work for others. So I agree, I will be more circumspect about completing issue summaries.
- πΊπΈUnited States nicxvan
taxonomy_theme_suggestions_taxonomy_term can be manually converted, the rector rule missed all theme suggestions.
- πΊπΈUnited States mcgovernm North Carolina
Tests started failing after adding the return type to hook_help in this commit. I have not been able to figure out why this would change anything.
Time: 00:37.972, Memory: 4.00 MB There was 1 failure: 1) Drupal\Tests\navigation\FunctionalJavascript\PerformanceTest::testLogin Failed asserting that 61 is identical to 60. /var/www/html/core/modules/navigation/tests/src/FunctionalJavascript/PerformanceTest.php:75
Line 75 of PerformanceTest.php:
$this->assertSame(60, $performance_data->getCacheGetCount());
- πΊπΈUnited States nicxvan
I wouldn't worry about it, unless you think this is ready for review at the moment. It's most likely an upstream change affecting that and will be fixed separately.
When I see these I usually try to track down the issue that introduced it, and open an issue to resolve it, but that's not strictly necessary if you're still working on other feedback on the issue.
- πΊπΈUnited States mcgovernm North Carolina
mcgovernm β changed the visibility of the branch drupal-3502014-3502014-clean-up-hook to hidden.
- Merge request !11134Splitting entity related hooks into separate class. β (Open) created by Unnamed author
- πΊπΈUnited States mcgovernm North Carolina
Putting back to needs work, as taxonomy_theme_suggestions_taxonomy_term still needs to be addressed.
- πΊπΈUnited States nicxvan
Sorry which branch? Can you hide the ones you're not using?
- πΊπΈUnited States mcgovernm North Carolina
mcgovernm β changed the visibility of the branch 3502014-clean-up-hook to hidden.
- πΊπΈUnited States mcgovernm North Carolina
mcgovernm β changed the visibility of the branch 11.x to hidden.
- πΊπΈUnited States nicxvan
Looks great!
Couple of comments, I didn't provide a lot of detail feel free to ping me on slack if you need clarification.
- πΊπΈUnited States nicxvan
Sorry I was looking at the old MR, is this ready for review again?
- πΊπΈUnited States mcgovernm North Carolina
Thanks! This is ready for review again. I had moved the setting of $config to a helper function, but wasn't sure after the last couple of comments if that was necessary or if it could have been left in the constructor for this case.
- πΊπΈUnited States smustgrave
Haven't reviewed because @nicxvan seems to be on it but love the file structure picked here.
- πΊπΈUnited States nicxvan
I think this is closer, I hate to say it, I think we came up with a decent rubric for the split in the meta: #3493453-25: [meta] Standardize and clean up hook classes in core β
I know you've been putting a lot towards this, but can we split the files based on the new thoughts I linked? Once that is in I think it's ready for a final review.
- πΊπΈUnited States mcgovernm North Carolina
Thanks for the feedback! I think it was just two classes that needed to be renamed based on the text file, this is ready for review.
- πΊπΈUnited States nicxvan
Two minor comments you can merge in then I think it's ready!
- π¨πSwitzerland berdir Switzerland
getConfig() is still broken. It does not return a Config object, it returns the ConfigFactory because the condition there is never TRUE to go inside the if condition.
It works because it does not have a return type, which I'm not sure why phpstan doesn't complain a about.
The tests pass because what actually happens is that it returns a new config object for the non-existing maintain_index_table config and that evaluates to true. We have no tests that disable this flag.
drop the if, add an explicit return type, and just make it a one-liner to return that config. Since that's the only config key we care about, I'd actually suggest to rename the method to something like shouldMaintainIndexTable() and directly return a boolean from that.
- πΊπΈUnited States mcgovernm North Carolina
Thank you @berdir! I've just pushed a commit to address that. I also noticed we still need to remove taxonomy_build_node_index and taxonomy_delete_node_index from taxonomy.module since they've been moved to TaxonomyEntityHooks. I should be able to get to that shortly.
- π¨πSwitzerland berdir Switzerland
Unsure about the helper functions. Unlike some others, they are not underscore-prefixed nor are they hooks, so technically they are an API. in https://git.drupalcode.org/project/drupal/-/merge_requests/10999#note_45... I proposed to keep them but deprecate them for D12.
- Status changed to Needs review
7 days ago 4:10pm 26 March 2025 - πΊπΈUnited States nicxvan
Made suggestions for all of the things that need tweaking I think.
- π¨πSwitzerland berdir Switzerland
FWIW, I specifically suggested to not introduce a helper service for the node indexing and keep them as protected functions. It's not an API that taxonomy module offers, so it makes more sense to me as protected methods. Yes, the logic is duplicated then on the functions, but I don't think there is a rule against that.
- πΊπΈUnited States nicxvan
Did you mean in a comment on the MR? I don't see that recommendation in these comments.
- π¨πSwitzerland berdir Switzerland
- Merge request !11646Reverting node index functionality to protected methods β (Open) created by Unnamed author
- πΊπΈUnited States mcgovernm North Carolina
Thank you @berdir. I've created a new branch and on it rolled back the commit that moved it to a service. New draft MR is here. Hopefully I've deprecated these correctly, I assume we'll need to update the CR to indicate these have been moved to protected methods?
- πΊπΈUnited States nicxvan
nicxvan β changed the visibility of the branch 3502014-EntityHooks to hidden.
- πΊπΈUnited States nicxvan
I updated the CR and hid the other approach, I think this looks good but I want to give @berdir a chance to look.