Problem/Motivation

When accessing the "Image styles usage" report provided by the xray_audit module, a 404 error occurs if the responsive_image module is disabled. Additionally, the following error is logged in the watchdog log:

The "responsive_image_style" entity type does not exist.

This suggests that the module does not correctly check for the existence of the responsive_image entity type before attempting to load it, leading to a fatal error in environments where the module is not enabled.

Steps to reproduce

  1. Ensure the responsive_image module is disabled.
  2. Navigate to: /admin/reports/xray-audit/content-metric/image-styles-usage
  3. Observe the 404 error and check the logs for the missing entity type exception.

Proposed resolution

Update the report builder logic to check if the responsive_image module is enabled before querying or interacting with the responsive_image_style entity type. This can be done using \Drupal::moduleHandler()->moduleExists('responsive_image') and conditionally adjusting the logic accordingly.

Remaining tasks

  • Implement the module existence check in the image style report generator.
  • Add a test to ensure the report does not fail when responsive_image is disabled.

User interface changes

No user interface changes expected.

API changes

No API changes expected.

Data model changes

No data model changes expected.

Issue fork xray_audit-3520333

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

juanjol created an issue. See original summary.

antonio nunez made their first commit to this issue’s fork.

antonio nunez’s picture

Assigned: Unassigned » antonio nunez

antonio nunez’s picture

Fixed two issues in the Image Styles Report:

  1. Resolved 404 error when accessing the report without the responsive_image module enabled - the plugin now properly checks module availability before attempting to load responsive image styles
  2. Addressed timeout issues by implementing conditional processing limits - when responsive_image is disabled, limits are applied (50 image styles, 100 view displays) to prevent timeouts; when enabled, all items are processed
    without restrictions.

These changes ensure the report remains accessible and functional regardless of the responsive_image module status.

antonio nunez’s picture

Refactoring and debugging of the timeout management in the image styles report, as well as correcting the coding standards according to phpcs, phpstan and cspell.

antonio nunez’s picture

Assigned: antonio nunez » Unassigned
Status: Active » Needs review

lpeidro made their first commit to this issue’s fork.

lpeidro’s picture

Version: 1.6.1 » 2.x-dev

I change the dev branch (2.x-dev).

lpeidro changed the visibility of the branch 3520333-404-error-and to hidden.

lpeidro changed the visibility of the branch 3520333-404-implement-batch-image-styles to hidden.

lpeidro’s picture

The logic for the report related to image styles has been updated. Several independent reports have been created, along with a summary. This approach helps reduce computational load and allows us to manage module dependencies in a more granular way.

Ready to review.

  • lpeidro committed 4400107c on 2.x
    Issue #3520333: Removing the test for image style report because is...

  • lpeidro committed 212686b3 on 2.x
    Issue #3520333: Fix Image Style test, we register the public schema
    

  • lpeidro committed 72db6cf9 on 2.x
    Issue #3520333: Fix Image Style test following the standard way to...

  • lpeidro committed 64c3b05f on 2.x
    Issue #3520333: Update Images Styles Plugin test
    

  • lpeidro committed 2f83ba3a on 2.x
    Issue #3520333: Added filter to image styles summary report
    

  • lpeidro committed 51cdb315 on 2.x
    Issue #3520333: Added dependency at operation level
    

  • lpeidro committed dbe199a6 on 2.x
    Issue #3520333: Refactor image styles report, independent tables to be...
lpeidro’s picture

Status: Needs review » Fixed

Task merged.

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.