Open markconroy opened 3 months ago
Might want a bit more discussion https://github.com/localgovdrupal/localgov_elections/issues/107#issuecomment-2298645589
Quick discussion in Merge Tuesday, from the original issue, we want to amend this to use the services reference field.
Do we want an update hook to add the services field ?
@Mjeffbrown @nccchris did you add the services field to your elections content ?
If no, then let's add an update hook.
(Or check to see if it is there and update if not)
Note: add in hook_modules_installed , check step-by-step for pro-forma.
Discussing at Merge Tuesday - we want to add the services parent here. There's example code in other modules that does this that can be copied.
This PR is updated now to follow the same pattern that LocalGov Directories uses.
However, although the field is placed on 'Manage form' page for the election content type, it says the field formatter is 'Autocomplete Deluxe' and I'm not sure how to change that since our code says to use 'entity_reference_autocomplete'.
@stephen-cox would you have a quick check of this and see if there's an easy fix?
Closes #107
What does this change?
Adds a "parent" field so we can use this for breadcrumbs and URL aliases.
Currently doesn't set any content types as allowed parents. If we did, it would mean a lot of dependencies for this module, where it currently has none. This means after you enable the module, you will then need to set what content types are allowed to be parents
How to test
Enable the module, create an election (or enable election demo content module), set a node as the parent and check that the URL inherits from the parent URL.
Have we considered potential risks?
This only applies to new installs currently, do we want an update hook to apply to current sites?