roryg / ElementHelper

Element Helper is a MODx Revolution plugin for automatically creating elements from static files without the MODx manager.
27 stars 10 forks source link

element_history not updating - elements not removed #23

Open leviwheatcroft opened 10 years ago

leviwheatcroft commented 10 years ago

elementHelper isn't removing elements when I delete them from the filesystem.

It looks as though elementhelper.element_history can be set/saved as something like:

a:1:{s:11:"modTemplate";a:5:{i:0;s:6:"tester";i:1;s:7:"project";i:2;s:6:"collab";i:3;s:4:"home";i:4;s:5:"basic";}}

The next time getOption is called it still returns

a:0:{}
roryg commented 10 years ago

HI there,

I plan on rewriting elementHelper soon to fix this bug among others. Unfortunately I don't have a fix for this at the moment but a workaround that has worked for me is to restore the element in the file system, modify the file (with some junk text) then save it and refresh the manager. At this point the element_history should get repopulated and deleting the file from the file system will remove it from the manager.

I'll hopefully have a new fixed/better/smarter version done in the next couple of weeks.

exside commented 10 years ago

Hm, if that is implemented (auto deleting of elements from the database), I would like it to be configurable in the settings because I actually "like" that behavior (of not deleting the elements from the db when they are deleted in the filesystem...)

leviwheatcroft commented 10 years ago

@roryg - that's awesome. It's a great plugin that has the ability to dramatically improve my workflow. I'm looking forward to the new version.

@exside - the "auto remove" setting should remove elements which are in the history (have been created by elementhelper) but are no longer in the filesystem. So it was always optional...