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

Bug in Publication Date module causes necessary node_field_data "published_at" property to not get created #18

Open
banoodle opened this issue Apr 24, 2024 · 0 comments
Assignees

Comments

@banoodle
Copy link
Contributor

banoodle commented Apr 24, 2024

Description

I first noticed this when using drupal-starter-installer with saplings to spin up the UCSF Psych site, but I thought/hoped it was a one-off glitch.

But now I see the same bug on UCSF OBGYN after using drupal-starter-installer with saplings. I don't see this problem on the Humane World site because it currently uses the legacy site's config rather than saplings config.

When the Publications Date module is manually enabled on a Drupal 10 site, the new "published_at" property gets added successfully to the node_field_date and node_revision_field_date tables in the database. This ensures there is a Published At input on the node edit form.

When the Publications Date module is enabled by saplings-content-types, the "published_at" property does not get created and the input on the front end is not displayed.

Bandaid

In order to repair Psych and OBGYN, I had to write the following update hook in a *.install file in a custom module. This update has to run on a deployment after and separate from the initial project deployment because it won't work on the same deployment that is enabling the Publication Date module.

/**
 * Add missing published_at property for publication_date module.
 */
function ucsf_obgyn_general_update_9001() {

  \Drupal::database()->schema()->addField(
    'node_field_data',
    'published_at', [
      'type' => 'int',
    ]
  );

  \Drupal::database()->schema()->addField(
    'node_field_revision',
    'published_at', [
      'type' => 'int',
    ]
  );
}

Proposed Resolution

I suspect this is caused by a bug in the Publication Date module. I haven't validated this, but I think adding a schema file to the module might fix this. I will test this and try to contrib a fix as time allows, but even if I write a patch, we can't apply it with the recipe. So any fix I might contribute, only fixes this saplings issue once the maintainer merges the fix.

So I think the best short term fix is to consider removing Publication Date from this recipe for now.

If we can get a fix into the stable release, we can add it back at a later time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants