XF 2.2 xf-dev:import fails to import all files

Justis R

Member
I'm collaborating with another developer on a particular addon, and as quoted here:
Most of it isn't really relevant. The meat of it is essentially
Code:
git pull
php cmd.php xf-dev:import
php cmd.php xf-dev:rebuild-caches

I pulled his changes, confirmed the files were as expected, then ran xf-dev:import and then rebuilt the caches.

Most of the changes seem to have been imported correctly. Templates, routes, controllers. However, the template modification he made has not been imported. I've verified that the template modification is correctly located within the output folder and is even correctly recorded in _output/template_modifications/_metadata.json However, the import hasn't picked it up, and running the import again yields the same results.

The cli output for the import command contains the log:

Code:
Importing template modifications...
Template modifications imported. (0.01s)
So we at least know the template modification import step was run.

If anyone has any ideas what might be causing this, I'd really appreciate it.
 
I pulled another class extension and ran the import and experienced the same issue once again with the class extension not being imported, without errors. Seems to solely effect class extensions.

EDIT: Nvm, it seems it's also not importing any phrases as well. I don't understand.
 
Last edited:
Update!

After weeks of xf-dev:import not importing the template mods or any phrases, despite all of them being present in the output folder, I thought I'd try doing a xf-addon:export, exported the _data files. Took a look inside and they were incomplete, just like on the board. Ran xf-dev:import again and then suddenly, for some reason, all of the phrases and template mods and everything got imported.

My understanding was that the _data files weren't used in the import, and given that they were incomplete, I know for certain that the import was pulling from the _output folder, so I truly don't understand why it wasn't importing them during the absence of a _data folder, but I've also not taken the time to read the code behind the CLI commands.

Given this:
When collaborating on a project with other developers, you don't need the _data XML files. These are purely for release distribution. If you're working off a version control system, your repo likely won't host them (I'd recommend having a .gitignore file to exclude them specifically).

Any one collaborating on the project will clone the repo, copy or symlink the files to the appropriate location for development and install the add-on with the CLI command which will automatically use the dev _output files php cmd.php xf:addon-install <AddOnId>.

If the add-on is already installed, then it's just a case of importing the dev _output files php cmd.php xf-dev:import --addon <AddOnId>.

For all intents and purposes, just forget _data even exists, exclude it from your VCS repos and remember to always install via the CLI. Seems simple enough to me, IMO.
I feel like the behavior I've experienced must be some sort of bug.

It's worth noting that the developer I'm collaborating with has experienced the exact same thing.
 
Last edited:
Back
Top Bottom