Skip to content
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

fix(SHS-6113): duplicate node access records due to bug in su_humsci_profile_update_9723() #1765

Conversation

dalin-
Copy link
Collaborator

@dalin- dalin- commented Feb 28, 2025

Summary

Some update hooks to clean up duplicate node_access records that caused fatal exceptions. Those dupes were caused because not all sites had per-node Content Access enabled. So these updates enforce that for the Private Page node type.

Need Review By (Date)

ASAP. We need to prevent other people from experiencing fatal exceptions in the live environment.

Urgency

high

Steps to Test

  1. Run drush updb and observe the output for su_humsci_profile_update_9725() and su_humsci_profile_update_9726()

On some sites you'll see output for 9725 to say that it enforced per-node Content Access. I haven't found a site that made any changes in 9726 (I suspect that the node_access_rebuild() called at the end of the previous update fixed those problems already).

Review Tasks

Backend / Functional Validation

Code

  • Are the naming conventions following our standards?
  • Are PHP functions and variables in snake_case and not camelCase?
  • Does Drupal code follow Drupal Coding Standards?
  • Does the code have sufficient inline comments?
  • Is there anything in this code that would be hidden or hard to discover through the UI?
  • Are there any code smells?
  • Are tests provided?

Code security

General

  • Is there anything included in this PR that is not related to the problem it is trying to solve?
  • Is the approach to the problem appropriate?

@ahughes3 ahughes3 temporarily deployed to Tugboat February 28, 2025 19:39 Destroyed
Copy link
Contributor

@joegl joegl left a comment

Choose a reason for hiding this comment

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

I tested this locally and it works. I just have a few formatting suggestions / requests. I am not going to hold this up from getting into the deployment on Wednesday for them.

It definitely appears the array_push in the previous update is the culprit and running array_unique solves the duplication.

I also double checked the custom module and didn't see anything concerning there: https://git.drupalcode.org/project/content_access_simple/-/blob/main/content_access_simple.module

@ahughes3 ahughes3 temporarily deployed to Tugboat March 3, 2025 22:39 Destroyed
@dalin- dalin- requested a review from joegl March 3, 2025 22:43
Copy link
Contributor

@joegl joegl left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @dalin-

@joegl joegl merged commit 9b34a32 into 11.8.1-release Mar 3, 2025
17 of 18 checks passed
@joegl joegl deleted the SHS-6113_Temp-UnavailableError-issue-with-Private-Pages-and-Menus branch March 3, 2025 23:16
@dalin-
Copy link
Collaborator Author

dalin- commented Mar 4, 2025

@joegl
In the latest push the Econ site was failing. Here's a commit to try and see why:
96aa9dc

@dalin-
Copy link
Collaborator Author

dalin- commented Mar 4, 2025

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.

3 participants