Problem/Motivation

Provide a drush report of visible content (node) changes for a given day. This would include the following:

  • any published content change
  • when published content is unpublished

It would exclude changes that are not public such as the creation of a new draft.

Note that this would mostly be for sites using content moderation because if content moderation/workflows are not enabled, all content changes are public (once there is a public version) and there are simpler ways to obtain that information.

Test Steps

(Ideally in a ddev environment)

Tests With Just Core

  1. In a vanilla Drupal site that already has the last release of revision_extras installed, pull this issue branch.
  2. Make sure there have been no content changes for today in the site and that symfony_mailer_lite is not installed.
  3. Run drush updb
  4. Run drush revision_extras:changed_content
  5. Confirm output is "No content changes for [today's date]"
  6. Run drush revision_extras:changed_content --email
  7. (Assuming a ddev environment) Run ddev mailpit and check that the site sent an email notification to the site email address that there were no content changes.
  8. Make a published content change (with new revision checked + a log message)
  9. Make another published content change to a different content type than the first (e.g. article if the earlier one was page) (with new revision checked + a log message)
  10. Unpublish a pre-existing content item (with new revision checked + a log message)
  11. Run drush revision_extras:changed_content
  12. Confirm output contains the 3 changes from today
  13. Run drush revision_extras:changed_content --format=json
  14. Confirm output contains the 3 changes from today in json format
  15. Run drush revision_extras:changed_content --email
  16. (Assuming a ddev environment) Run ddev mailpit and check that the site sent an email notification to the site email address that includes a plain text list of content changes.
  17. Run drush revision_extras:changed_content --email --recipient=example@example.com
  18. (Assuming a ddev environment) Run ddev mailpit and check that the site sent an email notification to example@example.com that includes a plain text list of content changes.
  19. Run drush revision_extras:changed_content [YYYY-MM-DD] (pick a date in the past)
  20. Confirm the output matches the content changes for that day
  21. Visit the configuration form at /admin/config/user-interface/revision-extras
  22. Exclude one of the content types where you made changes today
  23. Exclude a few fields from the report.
  24. Customize the recipient email for the report
  25. Add at least 2 emails to the group field on separate lines
  26. Save the configuration
  27. Run drush revision_extras:changed_content --email --group
  28. Confirm that the email was sent to the custom recipient and the group email addresses.
  29. Confirm that the report excluded the excluded fields (columns) and that the report did NOT include the excluded content type.

Tests with additional modules

  1. Run ddev composer require drupal/symfony_mailer_lite and drupal/diff (or otherwise add the modules and their dependencies)
  2. Enable symfony_mailer_lite and diff
  3. On /admin/config/content/diff/general make sure "visual inline" for diff is enabled.
  4. On /admin/config/system/mailsystem choose the Symfony Mailer Lite option for formatter and sender.
  5. (Assuming ddev) On /admin/config/system/symfony-mailer-lite/transport add an option for SMTP with host 0.0.0.0 and port 1025 Make it the default transport.
  6. Add $settings['mailer_sendmail_commands'] = ['/usr/sbin/sendmail -t']; to your settings.php file
  7. On /admin/config/system/symfony-mailer-lite/test send a test email to confirm that the mailer module is working correctly
  8. Visit the configuration form at /admin/config/user-interface/revision-extras
  9. Two new options for HTML format and attachments should appear.
  10. Check "Send email in HTML format." and "Include a CSV attachment of report results on the email." Customize the body of the email with content results and wrap the first sentence in a paragraph tag and save
  11. Run drush revision_extras:changed_content --email
  12. Confirm that the email sent contains an HTML table of the results along with an attached CSV with the results.
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

jastraat created an issue. See original summary.

jastraat’s picture

Issue summary: View changes

jastraat’s picture

Issue summary: View changes
jastraat’s picture

Issue summary: View changes
jastraat’s picture

Issue summary: View changes
jastraat’s picture

Issue summary: View changes
jastraat’s picture

Issue summary: View changes
jastraat’s picture

Issue summary: View changes
jastraat’s picture

Issue summary: View changes
jastraat’s picture

Status: Active » Needs review
jastraat’s picture

Status: Needs review » Active

Going to make some UX changes based on feedback!

jastraat’s picture

Issue summary: View changes
jastraat’s picture

Status: Active » Needs review
jasongose’s picture

Status: Needs review » Reviewed & tested by the community

The testing steps all pass (and they're great!).
It's looking good to me, I approve :)

  • jastraat committed a27eb359 on 1.0.x
    feat: #3556528 Add drush command for content change report
    
    By: @...
jastraat’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.