Page MenuHomeIn-Portal Phabricator

INP-1933 - Report Compiled Template removal errors
Needs ReviewPublic

Authored by alex on Sat, Dec 20, 5:49 AM.

Details

Reviewers
erik
Test Plan

Preparations

  1. apply the patch of the D551 (if not already applied)
  2. go to the CLI
  3. go to the /system/cache folder
  4. run the sudo rm -Rf core modules themes command (type your password if asked for) to delete all compiled templates
  5. in the IDE:
  6. open /tools/run_event.php for editing
  7. comment-out the exit_code(1, 'This script needs to be enabled manually !'); line
  8. save changes

Part 1 - web good

  1. login to the Admin Console
  2. go to the ToolsSystem Tools section
  3. use the Clear button in the Clear Templates Cache sub-section (will remove all files, but after the page is reloaded, the files for showing System Tools page will be compiled again)
  4. confirm that you're seeing green Last operation has been successfully completed! text without any errors

Part 2 - cli bad

  1. go to the CLI
  2. run the php tools/run_event.php adm:OnDeleteCompiledTemplates b674006f3edb1d9cd4d838c150b0567d command
  3. confirm that you're seeing this text (1st line is in red+bold), because you can't delete files in folders, owned by other users (folder owned by "apache", but you're deleting it as "user"):
Please manually delete paths:
1. /system/cache/core
  1. confirm, that exit code from running tools/run_event.php script was a non-zero by checking the output of the echo $? command

Part 3 - web bad

  1. go to the CLI
  2. run the sudo chown root:root system/cache/core/admin_templates/incs command (type your password if asked for) to change the owner of the folder, where compiled templates are stored
  3. login to the Admin Console
  4. go to the ToolsSystem Tools section
  5. use the Clear button in the Clear Templates Cache sub-section (will remove all files, but after the page is reloaded, the files for showing System Tools page will be compiled again)
  6. confirm that you're seeing this text (1st line is in red+bold), because you can't delete files in folders, owned by other users (folder owned by "root", but you're deleting it as "apache"):
Please manually delete paths:
1. /system/cache/core

Part 4 - cli good

  1. go to the CLI
  2. run the sudo chmod 777 -R system/cache command (type your password if asked for) to make all compiled templates writable
  3. run the php tools/run_event.php adm:OnDeleteCompiledTemplates b674006f3edb1d9cd4d838c150b0567d command
  4. confirm, that:
    • command produces no output
    • exit code from running tools/run_event.php script was zero by checking the output of the echo $? command

Diff Detail

Repository
rINP In-Portal
Branch
branches/5.2.x
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 11174
Build 3874: arc lint + arc unit