-
Notifications
You must be signed in to change notification settings - Fork 13
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
DDFHER-39 - deletion of opening hours category #1569
Open
kasperbirch1
wants to merge
6
commits into
develop
Choose a base branch
from
DDFHER-39-deletion-of-opening-hours-category
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
DDFHER-39 - deletion of opening hours category #1569
kasperbirch1
wants to merge
6
commits into
develop
from
DDFHER-39-deletion-of-opening-hours-category
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kasperbirch1
assigned kasperg, xendk and rasben and unassigned kasperg, xendk and rasben
Sep 16, 2024
kasperbirch1
force-pushed
the
DDFHER-39-deletion-of-opening-hours-category
branch
from
September 17, 2024 09:11
0bdc5bf
to
713d0c3
Compare
Allow the `administrator`, `local administrator`, and `editor` to delete an opening hour category. Unclear why this setting was previously enabled for `user.role.editor.yml`.
Now, when a user deletes a category, a message will display indicating the number of associated opening hours. To facilitate this, the `$categoryId` parameter was added to the `loadMultiple` method in the `OpeningHoursRepository`. At present, no specific action occurs on term deletion. Handling this will be part of the next commit.
This architecture caused several issues, but we eventually discovered that the problem was due to the order of submit callbacks. We resolved it by using `array_unshift($form['actions']['submit']['#submit'], 'dpl_opening_hours_term_delete_submit');` to adjust the order. However, we are not fully satisfied with this approach, and in the next commit, I have implemented `dpl_opening_hours_taxonomy_term_predelete` to handle the deletion process more cleanly.
Implemented `hook_taxonomy_term_predelete()` to automatically delete associated opening hours when a category term is deleted. This ensures that all related opening hours are cleaned up upon term deletion.
kasperbirch1
force-pushed
the
DDFHER-39-deletion-of-opening-hours-category
branch
from
September 17, 2024 09:33
713d0c3
to
38ddd85
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Link to issue
https://reload.atlassian.net/browse/DDFHER-39
Description
This pull request enables the administrator, local administrator, and editor roles to delete opening hour categories. Upon deletion, the user will be notified of the number of associated opening hours. Additionally, a pre-delete hook has been implemented to automatically remove all related opening hours when a category term is deleted.
Test
https://varnish.pr-1569.dpl-cms.dplplat01.dpl.reload.dk/admin/structure/taxonomy/manage/opening_hours_categories/overview
https://varnish.pr-1569.dpl-cms.dplplat01.dpl.reload.dk/node/10/edit/opening-hours