Skip to content

Render the error page on invalid media URLs#3202

Merged
lukasbestle merged 1 commit into
developfrom
fix/media-link-error-page
May 4, 2021
Merged

Render the error page on invalid media URLs#3202
lukasbestle merged 1 commit into
developfrom
fix/media-link-error-page

Conversation

@lukasbestle
Copy link
Copy Markdown
Member

Describe the PR

More consistent behavior that also allows overriding the error behavior with custom code on the error page.

Related issues

Ready?

  • Added unit tests for fixed bug/feature
  • Added in-code documentation (if needed)
  • CI passes (runs automatically when the PR is created or run composer ci locally)
    Running locally requires PHPUnit, PHP-CS-Fixer, Psalm, PHPCPD and PHPMD.

More consistent behavior that also allows overriding the error behavior with custom code on the error page.

Fixes https://forum.getkirby.com/t/adjusting-the-media-hash-generation/21456/14?u=lukasbestle.
@lukasbestle lukasbestle added this to the 3.5.4 milestone Mar 11, 2021
@lukasbestle lukasbestle requested a review from a team March 11, 2021 16:01
@lukasbestle lukasbestle self-assigned this Mar 11, 2021
@distantnative
Copy link
Copy Markdown
Member

Wondering whether this could be a breaking change for some setups - (for whatever reason) checking for text/plain on error responses but now getting HTML.

@lukasbestle
Copy link
Copy Markdown
Member Author

I don‘t think so. We previously had HTTP 404 already, so that would have been much more reliable to check for. But to be honest, I don‘t see many use-cases where you would need to check the response anyway (as the media URLs are mainly used for linking to files). Do you have an example use-case?

@distantnative
Copy link
Copy Markdown
Member

Having looked at it again, you're right: I think it's a good change that won't really cause issues anywhere.

Questions is if this is urgent or could wait until 3.6.0 since strictly it's a breaking change (public method returns something different now) - one that won't break many (if any) actual setups though.

@lukasbestle lukasbestle modified the milestones: 3.5.4, 3.6.0 Apr 18, 2021
@lukasbestle
Copy link
Copy Markdown
Member Author

You are right, it's probably better to move this to 3.6.0.

Marking it as draft to avoid that we merge it by accident. The code is already done.

@lukasbestle lukasbestle marked this pull request as draft April 18, 2021 20:45
@lukasbestle lukasbestle marked this pull request as ready for review May 4, 2021 20:19
@lukasbestle lukasbestle merged commit d7ae15d into develop May 4, 2021
@lukasbestle lukasbestle deleted the fix/media-link-error-page branch May 4, 2021 20:24
@lukasbestle lukasbestle modified the milestones: 3.6.0, 3.6.0-alpha Jun 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants