-
Notifications
You must be signed in to change notification settings - Fork 70
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
VACMS-17018 Resolve VAMC menu assignment issues. #16994
Conversation
@@ -80,4 +80,5 @@ function va_gov_media_clientside_validation_validator_info_alter(&$validators) { | |||
foreach ($validators as &$validator) { | |||
$validator['attachments']['library'][] = 'va_gov_media/cv.alt-text.validate'; | |||
} | |||
unset($validator); | |||
} |
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.
This is necessary to avoid the first pink warning on this page
https://www.php.net/manual/en/control-structures.foreach.php
A foreach by reference, must close the barn door by unsetting the referenced variable.
This was causing the last validation in the list of validations to appear twice, and get executed that way.
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.
All but one of the pages check out.
Can you confirm whether it should be locked or not?
Validate Womens Veteran care https://pr16994-ksy8sixki8oyk0owsscsp9ijgfxn7pfi.ci.cms.va.gov/node/3084/edit is not locked.
Result
124c170
to
ffcdcfc
Compare
// to be enabled. | ||
$menu_element_type = self::ENABLED; | ||
} | ||
|
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.
The reverted temporary fix from #16975
@@ -624,7 +620,7 @@ protected function preventUnintendedChangeOfParent(array &$form) { | |||
return; | |||
} | |||
// This is not new so check the current parent exists in the reduced form. | |||
elseif (!$current_menu_item_is_present || $this->isCurrentMenuSettingDisabled($form)) { | |||
elseif (!$current_menu_item_is_present || $this->isCurrentMenuParentDisabledAndLocked($form)) { |
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.
Renaming to make more accurate.
ffcdcfc
to
7ec149a
Compare
Existing defect: Selecting "- Select a value -" in Parent linkNote: I think this is a highly unlikely scenario. Staging:Saving as draft
Saving as published
SummaryThe current defect is mostly in the presentation of the value in the Parent Link field, as saving with "- Select a value -" ultimately results in no change, though the error message and the disabled state and value of the Parent link are misleading and would likely cause an editor to back out of the change by closing the window or refreshing the page. PR env:Saving as draft
Saving as published
SummaryThe new defect does actually prevent the saving the node under "Work with us" if the editor has chosen "- Select a value -". However, similarly to the above, this would likely cause an editor to back out of the change by closing the window or refreshing the page. |
This one is not locked, and I'm not sure why it would be. It's under Programs. That doesn't appear to exclude children in VAMC Menu Custom Access |
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.
@swirtSJW All QA but one checks out. "Whole health" was not locked, but I don't think that it should be. Please confirm.
Regarding the defect, I have already commented. To reiterate, I think it's an edge case and neither the current behavior or the new behavior is likely preferred. I leave it to you to decide the appropriate next step.
Yep it was a faulty QA step. Confirmed with old demo environment I updated the QA step to reflect that. |
That is a really good find. I think the draft tramples on things because there is contrib validation that will not allow change of menu with a draft when there is a published revision because menus didn't have revisions and workflow for a draft to associate with. So changing a menu on a draft save of a published is never possible, but I think the error messages might be trampling on each other and the lock state gets confused. As you say, neither the existing or the new experience are ideal. |
@omahane I think the behaviour / bug of the draft -> published empty -> to not being able to put the page back where it belongs is ok. It prevents anything bad from happening AND still does not allow them to move the page. As you said, this is a really slim edge case. There is a way where the form could look at the form_state to see what the value used to be, then allow that value, but there would be almost no way to detect it happening and only look up the default revision if needed. It would need to consult the default revision every time and I don't want to entangle that fix into this one. This edge case defect is unlikely and tricky but right now it favors data protection and is less broken than it was where the field became locked just by setting it to empty and trying to save. Created new defect ticket #17032 |
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.
QA checks out. I like the comments about the client-side validation, as this is such a narrow needle to thread.
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.
Nice work!
This reverts commit 0ef8e57. This commit bypassed the root cause of the issue and hardcoded a bypass.
7ec149a
to
bd08d10
Compare
Description
Relates to #17018 (or closes?)
Testing done
Screenshots
QA steps
What needs to be checked to prove this works?
What needs to be checked to prove it didn't break any related things?
What variations of circumstances (users, actions, values) need to be checked?
As user RS (VAMC Content creator and content publisher in one VAMC health system section)
Definition of Done
Select Team for PR review
CMS Team
Public websites
Facilities
User support
Accelerated Publishing
Is this PR blocked by another PR?
DO NOT MERGE
Does this PR need review from a Product Owner
Needs PO review
CMS user-facing announcement
Is an announcement needed to let editors know of this change?