modmore / Gitify

Command line toolkit to make managing a MODX site in git a lot easier.
MIT License
122 stars 55 forks source link

Mismatching Element Categories after build #175

Closed muzzwood closed 8 years ago

muzzwood commented 8 years ago

After building on staging server, many elements are now listed under incorrect categories.

For example my "MusicContentTemplate" was originally under Main->Music but is now just listed under Collections.

Mark-H commented 8 years ago

Can you please show your .gitify file, or at least the relevant category/element bits?

muzzwood commented 8 years ago

Gitify file: data_directory: _data/ backup_directory: _backup/ data: contexts: class: modContext primary: key context_settings: class: modContextSetting primary:

muzzwood commented 8 years ago

Looking in the _data/ directory, the elements appear to have the correct categories. So perhaps the problem is occurring during the build process. I'll try the process again and report back.

Mark-H commented 8 years ago

Try moving the categories before the TVs bit, that could be messing things up on a clean environment.

An issue in the build step is likely. Try using Gitify build --verbose to see what it's doing in more detail, and/or Gitify build --force to first wipe the relevant tables clean to make sure there's no conflicts.

muzzwood commented 8 years ago

Hi Mark, what do you mean by moving the categories before the TVs?

I started again from scratch install:modx ran fine.

install:packages --all produced the following error when it tried to install minishop2:

[2016-02-01 01:55:18](INFO @ ../Gitify/Gitify) Trying to install pdoTools. Please wait...

Fatal error: Call to a member function getObject() on a non-object in /public_html/core/packages/minishop2-2.2.0-pl2/modCategory/d12c340d640aaa19cad42879b2687ee9.resolve.setup.resolver on line 9

But I assume this is just because minishop tries to install pdotools and perhaps that way of doing things is incompatible with Gitify. Running install:packages -all again worked without a hitch.

muzzwood commented 8 years ago

I tried again - this time I ran install:package pdotools before running install:package --all and that corrected the error above.

The mismatching of categories is still happening though. I don't know the inner workings but I'm assuming this is because the installation of packages are taking the ids due to them being installed in a different order to how they were in development.

Would building before installing the packages work at all?

muzzwood commented 8 years ago

OK manually deleting everything in the cache folder fixed the issue. I had been just clearing the cache that had been generated from the install commands and I know the build command was attempting to clear the cache too but it wasn't enough. In hindsight I should have compared the db tables to the gitify files. Perhaps as a new feature, the build process could delete everything in the cache folder rather than clearing it?

Thanks for the help :)