Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
configuration system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
9 Oct 2013 at 23:26 UTC
Updated:
29 Jul 2014 at 23:02 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
ianthomas_ukAnd here's a patch
Comment #2
ianthomas_ukOh, if you're wondering I just removed the contents of the update hook because there wasn't really anything to update - it gets added to a list on install, removed on delete. Real code would need to be cleverer than this anyway.
Comment #4
ianthomas_ukUm, I'm pretty sure these functions never get called, so I'm going to assume that was a test suite error and try the test again.
Comment #5
ianthomas_ukOK, that was a different test that failed this time...
(For the record: Ensure the right member time is displayed.
Drupal\user\Tests\UserAdminListingTest->testUserListing())
Comment #6
ianthomas_uk#1: 2108679-menu-docs-1.patch queued for re-testing.
Comment #7
ianthomas_ukThis shouldn't be specifying the defaults inline, and should have code to initialise the variable when the module is installed (CMI will handle the cleanup on uninstall).
Comment #8
catchI know this is just an API example but this should at best be state, or possibly try to come up with another example - but using configuration for tracking state we shouldn't be recommending even in a hook example.
Comment #9
ianthomas_ukTBH the example doesn't really make much sense to me anyway.
Are example implementations required? The only code implementing this that I can find is the xmlsitemap module, which just seems to use it to set some defaults. I'm not even sure the hooks are needed in 8.x.
Comment #10
catchWe still have menu_menu_insert(), although that looks iffy to me.
Comment #11
xjmComment #12
ianthomas_ukThese hooks are rarely used, and while in D7 they were real hooks (http://drupalcode.org/project/drupal.git/blob/8649db189df672d379d2c587f3... ), in D8 they are just implementations of hook_{$entity_type}_insert (see EntityStorageControllerBase::invokeHook).
Does anyone have any objections to just removing these examples?
Comment #13
ianthomas_ukPatch to remove this documentation
Comment #14
alexpott13: 2108679-menu-docs-13.patch queued for re-testing.
Comment #15
vijaycs85Seems #13 answers @catch concern at #10. Lets get @catch comment before RTBC.
Comment #16
sunRight now, we still have entity-type-specific API hook examples in
.api.phpfiles.hook_menu_*()is comparable tohook_node_type_*(), andnode.api.phpcontains examples for that.Removing all of the entity-type-specific API hook examples was partially discussed in #1757586: Remove MODULE_load*() & Co functions in favor of entity_*() functions and is very debatable, so I'd recommend to not get into that discussion here.
To KISS, can we simply convert from variable to state?
Comment #17
alexpottConverting to state sounds like a good idea
Comment #18
sunOr even better, ditch that entire example (because it's pointless) and use the same silly examples of
hook_node_type_*().While being there, also fixing the phpDoc and function signatures.
Comment #19
alexpottWorks for me.
Comment #20
webchickCommitted and pushed to 8.x. Thanks!
Comment #21
sunHm. This commit was not actually pushed? At least it doesn't appear for me?
Comment #22
webchickSigh. :P pushed for real this time. Thanks.