Damaged file template

At “Editor/ File and Code Templates”, I have a template for “HTTP Request” that I need to update. For some reason, the template appears twice (with same content) and I cannot apply changes to either copy, nor does the “-” icon gets enabled. I get the same error when I select “Revert to Original Template”. How can I clear this?

0

Hi there,

Can you show what you have in the IDE_CONFIG/options/file.template.settings.xml file?

There is a chance that it has the same entry listed twice…

0

I forgot to mention I'm using KDE Plasma on Ubuntu, and I installed the IDE through JetBrains Toolbox.

I've looked inside “~/.config/JetBrains/PhpStorm2024.1” and also project's “.idea” directory, and I couldn't find a file with that or a similar name.

I've searched for the template name ("HTTP Request") and I've found many references in global settings directory:

$ find . -name '*HTTP Request*'
./fileTemplates/HTTP Request.http
./fileTemplates/internal/HTTP Request.http
./jba_config/templates/AGV HTTP Request.xml
./templates/AGV HTTP Request.xml
./settingsSync/fileTemplates/HTTP Request.http
./settingsSync/fileTemplates/internal/HTTP Request.http
./settingsSync/templates/AGV HTTP Request.xml
$ grep -r 'HTTP Request' *
grep: app-internal-state.db: binary file matches
jba_config/templates/AGV HTTP Request.xml:<templateSet group="AGV HTTP Request">
options/other.xml:    "FileTemplates.SelectedTemplate": "HTTP Request",
options/other.xml:    "LayoutCode.rearrangeEntriesHTTP Request": "false",
settingsSync/templates/AGV HTTP Request.xml:<templateSet group="AGV HTTP Request">
grep: settingsSync/.git/index: binary file matches
grep: tasks/REDACTED_Backend.contexts.zip: binary file matches
grep: tasks/REDACTED_Backend.tasks.zip: binary file matches
templates/AGV HTTP Request.xml:<templateSet group="AGV HTTP Request">
workspace/2BCauGwFajVy8ZCmPdGkkKAgyfs.xml:    "HTTP Request": {
workspace/2BCauGwFajVy8ZCmPdGkkKAgyfs.xml:    <language id="HTTP Request">
<SNIPPED>
0

I was thinking it will be there. Similar to this ticket: https://youtrack.jetbrains.com/issue/WI-76942

0

Backup and try deleting the following files:

./fileTemplates/HTTP Request.http
./settingsSync/fileTemplates/HTTP Request.http

Do it while the IDE is closed, of course.

0

I backed up the entire directory, closed PhpStorm and deleted those files, and I could still see the duplicate templates.

So I copied the template content from the UI and wiped out all the files with “HTTP Request” on their name. After that, I only saw one (empty) template, which I was able to edit normally.

Thank you.

Edit: The files I removed starting with “AGV ” turned out to be Live Templates (luckily I always keep a hundred backup copies of everything). I've no idea of what got corrupted, maybe it had to do with settings sync, I don't know.

 

0

It's broken again!

 I've restored yesterday's backup, done shortly after fixing the problem, and it's already broken there. I suspect that settings sync is bringing back the damaged templates. So I've disabled sync and deleted cloud data. I'm removing files again. I'll let you know how it works.

0

File templates were fine for several days, so I re-enabled settings sync. Now the HTTP Request template is damaged once again.

This is so frustrating. I'll just leave it the way it is and, when I need to edit the template in the future, I'll do the manual clean up and disable settings sync once and for all.

0

Hello,

This is a known issue with the Settings Sync and Templates that is filed here https://youtrack.jetbrains.com/issue/IJPL-148360. Please vote for it to be aware of further updates.

1

请先登录再写评论。