Conversation
3 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR retires the “princess” (DDS) feature set from the servicenow Drupal module by removing the related services, routes, plugins, form, config, and database artifacts.
Changes:
- Removed princess list/lookup plugins, service definitions, and the department-selection route/form.
- Removed princess-related user field updates and form-alter logic from
servicenow.moduleandServicenowUserLookup. - Added update hooks to delete the princess node/webform and drop the
princess_listtable; removed theprincess_rebuildconfig key.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/Plugin/ServicenowUserLookup.php |
Stops writing princess-related user fields during ServiceNow profile sync. |
src/Plugin/ServicenowFetchSettings.php |
Removes princess rebuild getters/setters, leaving only drupal form list flag access. |
src/Plugin/PrincessList.php |
Deleted: removes princess list caching/rebuild logic. |
src/Plugin/LookupPrincess.php |
Deleted: removes “lookup princess user” helper. |
src/Form/ServicenowDepartment.php |
Deleted: removes the department selection form used by princess flow. |
servicenow.services.yml |
Removes princess-related services from the container. |
servicenow.routing.yml |
Deleted: removes the /desktop-support-dept route. |
servicenow.module |
Removes princess-specific form-alter + submit handling + cron reload behavior. |
servicenow.install |
Adds update hooks to delete princess content and drop the princess table; removes install/schema logic for it. |
config/install/servicenow.settings.yml |
Removes princess_rebuild default config entry. |
Comments suppressed due to low confidence (1)
src/Plugin/ServicenowUserLookup.php:50
- In the no-secondary-department branch you assign
$department2 = ''but never write it back to the user entity. If a user previously hadfield_user_department2set and then losesu_secondarydepartment, the old value will remain stale. Consider explicitly clearingfield_user_department2in theelsebranch (and/or whenu_secondarydepartmentis empty).
if (!empty($result->result[0]->u_secondarydepartment->value)) {
$query_dept2 = ['sys_id' => $result->result[0]->u_secondarydepartment->value];
$dept2 = $api_call->apiCallMeMaybe('cmn_department', $query_dept2);
$department2 = Xss::filter($dept2->result[0]->name);
$account->set('field_user_department2', $department2, TRUE);
}
else {
$department2 = '';
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
71
to
76
| $sn_table_type = $form['elements']['sn_table']['#default_value'] ?? 'incident'; | ||
| if ($sn_table_type == 'incident' || 'ticket' || 'u_gnrl_req' || 'u_sec_task') { | ||
| foreach (array_keys($form['actions']) as $action) { | ||
| if ($action != 'preview' && isset($form['actions'][$action]['#type']) && $form['actions'][$action]['#type'] === 'submit') { | ||
| // If node 16699 set the impact field. | ||
| if ($form_id == 'webform_submission_dds_desktop_support_node_16699_add_form') { | ||
| $form['actions'][$action]['#submit'][] = 'servicenow_client_princess_submit_api'; | ||
| } | ||
| $form['actions'][$action]['#submit'][] = 'servicenow_client_submit_api'; | ||
| } |
This file contains hidden or 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
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.
Describe context / purpose for this PR
Retire princess
Issue link
#1230
Any other related PRs?
Link to MultiDev instance
http://md-1230-ucbsub-oit.pantheonsite.io
Checklist for PR author