Opened 8 years ago
Last modified 6 years ago
#46637 new defect (bug)
Corrupted functions.php file after editing in built-in theme editor
| Reported by: | SergeyBiryukov | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Themes | Version: | 5.6.1 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
Got at least two reports of the following scenario.
When editing the functions.php file of a theme, WordPress says: "Unable to communicate back with site to check for fatal errors, so the PHP change was reverted." However, the reverted file has 0 bytes length, and has to be recovered from a backup copy.
From what I can see, this can only happen in two cases:
- file_get_contents() could not properly read the file contents.
- The file is writable and fwrite() succeeded, but file_put_contents() did not.
Don't have any more details at this point, created the ticket as a reference for investigation.
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
I am also facing this exact same issue. Lost the entire functions.php file due to this.