Not a bug Template not upgrading

AndyB

Well-known member
Affected version
XF v2.1.0
On my live site I'm not able to upgrade my Calendar add-on. No matter what I try the following two templates will not upgrade.

andy_calendar
andy_calendar.less

Both should upgrade to version_id 41 and version_string 4.1.

197457

I can install the Calendar add-on fine on a test forum, but not able to install on my live forum.
 
Unfortunately there's not enough to go on here. If templates aren't being updated generally then that would be an issue which would become very quickly apparent considering how many add-ons there are, and even XF itself which essentially uses the same add-on data/template versioning as add-ons.

It's also odd that you're reporting this issue on one install, but not the other. There may be specifics to that install that are the anomaly here rather than the code itself.

I've done some limited testing, and template versions are updating as I would expect them to.

My best guess at this stage is that the src/addons/Andy/Calendar/_data/templates.xml file is out of date and the version details for those templates in that file are the old ones.
 
Thank you for taking the time to look into this, Chris.

I have looked at the src/addons/Andy/Calendar/_data/templates.xml very carefully but can't see any reference to the old version_id or version_string.

If I edit the andy_calendar and andy_calendar.less templates on my dev site by just having one line "test", then build-release, then copy the folder to the live site, then rebuild the add-on, I get this:

197486

As you can see the two templates are updated. However when I run the add-on it still shows the old template and then when I check using phpMyAdmin the values are restored back to values I show in post #1.
 
Is your live site in debug/designer mode?

It could be your live site is using obsolete info for the add-on if it is because it's info hasn't been synced.
 
Live site:
Code:
<?xml version="1.0" encoding="utf-8"?>
<templates>
  <template type="public" title="andy_calendar" version_id="41" version_string="4.1"><![CDATA[test]]></template>
  <template type="public" title="andy_calendar.less" version_id="41" version_string="4.1"><![CDATA[test]]></template>
...

Dev site:
Code:
<?xml version="1.0" encoding="utf-8"?>
<templates>
  <template type="public" title="andy_calendar" version_id="41" version_string="4.1"><![CDATA[test]]></template>
  <template type="public" title="andy_calendar.less" version_id="41" version_string="4.1"><![CDATA[test]]></template>
...
 
Do you have files in your _output/templates/public directory for these templates?

You nailed it, Chris.

In the live site the old template code remains.

197488

I don't understand the purpose of the _output folder. In the dev site the files are updated, but not in the live site.
 
Oh I think I understand what's going on.

When I do a xf-addon:build-release Andy/Calendar the _output folder is not included. Yet on the local computer the Andy/Calendar folder has old _output folder in the local file. So When I copy that to my live site I continue to copy old template code. The trick appears to be to make sure there's no _output folder on the live site.
 
Oh I think I understand what's going on.

When I do a xf-addon:build-release Andy/Calendar the _output folder is not included. Yet on the local computer the Andy/Calendar folder has old _output folder in the local file. So When I copy that to my live site I continue to copy old template code. The trick appears to be to make sure there's no _output folder on the live site.
That's why I asked if your live site was in debug/design mode. If it is, it will use the _output folder for info if it exists. Not the _data folder.
 
The _output folder allows you to edit those templates on the file system. With development mode enabled, changes to the template contents in there will be taken as being the up to date development files.

Your live site probably doesn't need development mode enabled. You would only need development mode enabled on your live site if you were editing development related stuff on it, master versions of stuff etc, which as it's a live site, you shouldn't be doing.
 
Your live site probably doesn't need development mode enabled.

Thank you, Snog and Chris.

I find it better to always be in development mode in both my dev and live site. Question is there a way to be in development mode yet not create the _output files. I never edit templates in the file system so I don't need this feature.
 
Back
Top Bottom