-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi page types #16
base: 1.x
Are you sure you want to change the base?
Multi page types #16
Conversation
… can help to determine what's in a subsite. Added handling for guides.
localgov_subsites_extras.module
Outdated
@@ -69,5 +71,40 @@ function localgov_subsites_extras_entity_bundle_create($entity_type_id, $bundle) | |||
$type->setThirdPartySetting('menu_ui', 'available_menus', $availableMenus); | |||
$type->save(); | |||
} | |||
} | |||
|
|||
// phpcs:disable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it better to make the code meet Drupal standards?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drupal's code style rules don't let you implement hooks for other modules like I've done here, as they insist on the function prefix being the module name. This is just a temporary thing anyway, as I'd like to move those hooks to the modules that provide those types & fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just taking a quick look, would an event and event subscriber be better here? And then the module can provide appropriate events for known localgov drupal content types until we can agree on a place to move it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've moved the hooks to their own file. Putting them there instead of in the module means that phpcs doesn't enforce the "function names must start with the module name rule", so I can re-enable phpcs on them.
I'm not against moving from hooks to an event. I don't think it's obviously better though. What do you reckon @Polynya?
Discussing briefly in Merge Tuesday, sounds like a bit more testing might be needed before approving. I'll try to test soon. |
I haven't had chance to test this yet but can you change a line in walkMenuTree like this:
This should prevent an error if a node has a menu parent that is not a node, e.g. events below the listing page. |
Good spot. I've added that. |
…_subsites_extras_current_node().
… so we don't have to ignore them for code style checks.
Implements #2