Follow-up of #3017935: Media items should not be available at /media/{id} to users with 'view media' permission by default .

As pointed out in my comment, the update being a post update means that it is not possible for distributions/install profiles to provide an update function that will set it to FALSE by default.

The post update function should check that the value is still NULL before setting it, that allows to have a different update or post update that sets the value differently.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir created an issue. See original summary.

johnchque’s picture

Status: Active » Needs review
FileSize
721 bytes

Ouch! Maybe we should consider to changing to a normal update function. Anyway, update the post update already existing.

Status: Needs review » Needs work

The last submitted patch, 2: media_post_update_true-3036787-2.patch, failed testing. View results

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

johnchque’s picture

Version: 8.8.x-dev » 8.7.x-dev
Status: Needs work » Needs review
FileSize
722 bytes
568 bytes

My bad, this should work instead.

Berdir’s picture

Status: Needs review » Needs work

I would suggest we first get a $config object with getEditable() and then use that same object to check the value and set it, should be easier to read.

johnchque’s picture

Status: Needs work » Needs review
FileSize
693 bytes
651 bytes

That's true, reads way better now. :)

Berdir’s picture

Status: Needs review » Reviewed & tested by the community

Thanks. I think test coverage for this seems a bit overkill.

Still not sure why this is a post update function, changing plain config in a regular update is OK. If it would be then we wouldn't need this and could simply make sure our own update runs after that.

alexpott’s picture

Category: Task » Bug report
Status: Reviewed & tested by the community » Fixed

I think this is a bug and given it is update related I think we should get this in before 8.7.x. I agree that test coverage is OTT.

Committed and pushed be7966d8e3 to 8.8.x and d0aab49b3a to 8.7.x. Thanks!

  • alexpott committed be7966d on 8.8.x
    Issue #3036787 by yongt9412, Berdir:...

  • alexpott committed d0aab49 on 8.7.x
    Issue #3036787 by yongt9412, Berdir:...

  • alexpott committed d0aab49 on 8.7.x
    Issue #3036787 by yongt9412, Berdir:...

Status: Fixed » Closed (fixed)

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