Skip to content

princess list removed UCBoulder/oit_dingo#1230 - #5

Merged
protitude merged 1 commit into
1.3.xfrom
md-1230
Apr 14, 2026
Merged

princess list removed UCBoulder/oit_dingo#1230#5
protitude merged 1 commit into
1.3.xfrom
md-1230

Conversation

@protitude

Copy link
Copy Markdown
Collaborator

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

  • I have checked that the PR is ready to be merged
  • I have reviewed the DIFF and checked that the changes are as expected
  • I have assigned myself or someone else to review the PR

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.module and ServicenowUserLookup.
  • Added update hooks to delete the princess node/webform and drop the princess_list table; removed the princess_rebuild config 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 had field_user_department2 set and then loses u_secondarydepartment, the old value will remain stale. Consider explicitly clearing field_user_department2 in the else branch (and/or when u_secondarydepartment is 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 thread servicenow.module
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';
}
Comment thread servicenow.install
@protitude
protitude merged commit be63ec3 into 1.3.x Apr 14, 2026
5 checks passed
@protitude
protitude deleted the md-1230 branch April 14, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants