Wrong path generated in README.txt in sync directory

Created on 24 October 2015, about 9 years ago
Updated 20 November 2023, about 1 year ago

Problem Motivation

README.txt file in sync directory has To make this configuration active, visit admin/config/development/configuration/sync, but in case the path is visited it leads to *Page not found*

Proposed resolution

Change the path in SiteSettingsForm.php
Add a update hook to update existing sites, ensure the file is writable
Add a Update test

Remaining Tasks



Review
Commit

🐛 Bug report
Status

Fixed

Version

10.2

Component
Configuration 

Last updated about 17 hours ago

Created by

🇮🇳India a_thakur

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • Status changed to Needs review about 1 year ago
  • 🇵🇪Peru marvil07

    I started a new merge request, 5457, with a commit using patch from #33.

    We should ensure that the file is writable. It is possible that the site has chosen to make the sync directory not writeable.

    @alexpott, I added extra validation around this.
    On the cannot-write case, nothing is done.

    This still needs an update test.

    @quietone, I added an update test.
    Please notice that the update tests do not really write the config synchronization directory, as the normal install does.
    So, instead, I am writing the readme file manually before running the updates.

    The set of commits on the merge request are the following.

    - ece085606a Issue #2600558 by a_thakur, vsujeetkumar: Wrong path generated in README.txt in sync directory
    - 5c3f034701 Rename hook_update_N to be the second 10.2.0 system update
    - 12e0cc171c Use a message on the hook_update_N
    - b4efa18839 Validate if the readme file can be written
    - 02c2c29dd3 Add an update test
    - cecfd695f7 Fix indent

    Back to NR.

  • Status changed to RTBC about 1 year ago
  • 🇺🇸United States smustgrave

    Applied the MR locally, ran the update hook and that ran without issue by checking the README.txt in my sync folder (which current is default)

    Update tests were added

    Ran test-only feature and got

    1) Drupal\Tests\system\Functional\Update\ConfigSyncReadmeUpdateTest::testConfigurationSynchronizationReadmeUpdate
    Failed asserting that 'Original content had admin/config/development/configuration/sync as path' does not contain "admin/config/development/configuration/sync".
    /builds/issue/drupal-2600558/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:121
    /builds/issue/drupal-2600558/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php:55
    /builds/issue/drupal-2600558/core/modules/system/tests/src/Functional/Update/ConfigSyncReadmeUpdateTest.php:41
    /builds/issue/drupal-2600558/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
    FAILURES!
    Tests: 1, Assertions: 180, Failures: 1.
    
  • 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10

    Issue credits

  • Status changed to Needs review about 1 year ago
  • 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10

    Just one minor change now this has missed the 10.2 window

  • Status changed to Needs work about 1 year ago
  • 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10

    Proper status

  • First commit to issue fork.
  • Status changed to Needs review about 1 year ago
  • 🇮🇳India ankithashetty Karnataka, India

    Updated the MR as per the change request made in #44, thanks!

  • Status changed to RTBC about 1 year ago
  • 🇺🇸United States smustgrave

    Small tweak to 10.3 was done.

  • Status changed to Needs work about 1 year ago
  • 🇬🇧United Kingdom alexpott 🇪🇺🌍

    Added some feedback to the MR

  • Status changed to Needs review about 1 year ago
  • 🇵🇪Peru marvil07

    @smustgrave, @larowlan, @alexpott: thanks for the feedback.
    @ankithashetty, thanks for the extra fix.

    I have added some extra changes around the provided feedback.

    - 0a0a1798b6 No operation if readme is not there
    - 1b71aa71f6 Replace the URL path instead of rewriting the whole file
    - 858815f640 Move new hook_update_N implementation to a new hook_post_update_NAME

    Back to NR.

  • Status changed to RTBC about 1 year ago
  • 🇺🇸United States smustgrave

    Seems feedback has been addressed

  • Status changed to Fixed about 1 year ago
  • 🇬🇧United Kingdom alexpott 🇪🇺🌍

    Committed 549b1e3 and pushed to 11.x. Thanks!
    Committed caff00d and pushed to 10.2.x. Thanks!

    I've removed the update path and test and committed the fix to 10.2.x so new sites are not affected by this.

    • alexpott committed 549b1e36 on 11.x
      Issue #2600558 by marvil07, a_thakur, vsujeetkumar, alexpott, smustgrave...
    • alexpott committed caff00df on 10.2.x
      Issue #2600558 by marvil07, a_thakur, vsujeetkumar, alexpott, smustgrave...
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024