[Resolved] Error while using the toolset installer to push content template updates
This thread is resolved. Here is a description of the problem and solution.
Problem:
I exported Views from Toolset settings >> extracted and re-zipped file >> Then try to import the new views.zip file and it fails.
Solution:
This issue was not reproduced and it turns out that client was doing something wrong while generating zip file. Please make sure when you re-zip file there is no folder existing within the zip file, xml and settings file should be without any folder within the zip. Sample Views exported files here: https://drive.google.com/file/d/0B5EmJQ1qcuyqTm1Ic2plWTNsTWc/view?usp=sharing
I generate myself the types.zip and views.zip and layouts.zip because it is so much simpler to edit the xml files than creating a dummy dev site and exporting those archives. Then instead of distributing the theme via your site, I test it directly (again, way simpler in my development process).
It works fine for types.zip, but the import always fails for views.zip, as long as I am the one generating the .zip (even if I didn't touched the xml file). Is this due to the settings.php file which contains a timestamp ? Do I have to generate a specific timestamp here ?
But the import always fails for views.zip, as long as I am the one generating the .zip
==> I am not sure how you have created the Views xml zip file at your own? The recommended way is to export these files from Toolset -> Export/Import page, otherwise it will not work.
And one needs to have an Author Account or license to build toolset based theme: https://toolset.com/buy-toolset-author/
There have been different checks in the plugin for security purpose that will break functions if you don’t have correct license or if process is not followed as exactly defined, since Types has a free version also that might be the reason you were able to get it work somehow outside our defined process.
I do have the correct licence since I am able to do the full stuff by strictly following the "recommended way". Still, exporting files from Toolset -> Export/Import page is very inconvenient for me for several raisons:
1/ You cannot choose what to export, so you might end up with some junk you dont need.
2/ You cannot handle your changes in a git repo
3/ It takes a LOT of time, and for small modification, changing the xml file directly is way better: managed by git, doable in my own IDE, etc etc
Basically when I develop a theme, I work as a developper: git + IDE. Switching to a "toolset" based development inside wordpress dashboard is something I want to avoid. Obviously it's great for my users, but again, as a theme developper, I need to be able to code in my usual environment.
1. Please let us know how you have exported the Views zip file using Toolset >> Export/Import page?
2. And then modified it using some code editor >> and then tried to import it again using Toolset >> Export/Import page?
3. And what exactly you have modified in xml file by editing it in code editor?
4. Please provide us step by step details with example change you have made, screenshots of steps or xml file also will help us to see whats going on with it.
5. Send me your Views exported original xml file and edited xml file as well, you can upload it to Google Drive or Dropbox and share links with me.
Typically we do not recommend editing XML files once exported from any Toolset plugin, as it often cause issues.
Thx for your kind answer.
1. Please let us know how you have exported the Views zip file using Toolset >> Export/Import page?
-> Yes
2. And then modified it using some code editor >> and then tried to import it again using Toolset >> Export/Import page?
-> Not exactly... I am in fact using the zip file inside my theme files, into the "update library":
wp-content/themes/my-theme/library/toolset/settings/views.zip
3. And what exactly you have modified in xml file by editing it in code editor?
-> As it didn't worked, I event tried not to modify ANYTHING. So the initial zip files work, but if I unzip it and zip it again, the new archive won't work.
4. Please provide us step by step details with example change you have made, screenshots of steps or xml file also will help us to see whats going on with it.
-> I hope my explanation is good enough... but the end result (failure state) is shown in the attached printscreen.
5. Send me your Views exported original xml file and edited xml file as well, you can upload it to Google Drive or Dropbox and share links with me.
-> As explained I don't think it's relevant, as a forged archive does not work, event if the files inside are exactly the same ones as those contained in an "original" views.zip file that indeed works.
Typically we do not recommend editing XML files once exported from any Toolset plugin, as it often cause issues.
-> I completely understand. Obviously, I am not in the "usual" use case. I really appreciate your help and I understand that I am pushing Toolset out of the "usual boundaries". Still, for theme developers, I think my issue is relevant.
Thank you for providing detailed explanation. Now I understand your actual issue. So the basic problem is just about re-zipping the Views zip file (that was exported from Toolset):
“ So the initial zip files work, but if I unzip it and zip it again, the new zip file won't work. ”
-----------------------------
Whereas this same re-zipping process works fine for Types zip file.
I am going to reproduce this issue at my end and see what happens when I export >> re-zip >> and import the re-zipped file. Then I will be able to escalate it accordingly. I will update you with my findings.
I have tested it at my end, below is what I found:
- I exported Views zip file using Toolset >> Export/Import page -- (filename: views-training.views.2017-09-08.zip)
- Imported that into another site using Toolset >> Export/Import page -- (filename: views-training.views.2017-09-08.zip)
- It imported Views and worked fine.
- After that I unzip and re-zip the Views file -- (filename: view-re-zip.zip)
>> I used Winrar software to zip the file.
- Imported this new zip file again using Toolset >> Export/Import page.
- It imported Views and worked fine as well.
Here are both my original views and re-zipped views file, so you can test these by importing directly or from within your theme update process: hidden link
Please make sure when you re-zip file there is no folder existing within the zip file, xml and settings file should be without any folder within the zip.
At this point, it looks like there might be something wrong with the Views file or your site that is breaking the process, or something like that.