Ticket #1301 (closed defect: fixed)
[PATCH] Improved reloading mechanism in TurboKid
| Reported by: | chrisz | Owned by: | faide |
|---|---|---|---|
| Priority: | high | Milestone: | 1.0.2 |
| Component: | Kid | Version: | 1.0 |
| Severity: | major | Keywords: | |
| Cc: |
Description
The reloading mechanism in TurboKid? did not work properly when you have two templates that are dependent on the same base template. When you update the bas template and load the first template, the template and its base template is reloaded. But when you load the second template, it is not reloaded though its base templated has changed. This leads to an incompatibility of the template and its base template, resulting in the notorious "Initialize / NoneType? not callable bug".
The attached patch improves the reload logic. We do not store the mtime for the template files, but the maximum of the mtime of the template and all its base templates. If a base template has been touched, the template will also be reloaded.
Attachments
Change History
comment:1 Changed 5 years ago by jorge.vargas
- Owner set to jorge.vargas
- Component changed from unassigned to Kid
Changed 5 years ago by chrisz
-
attachment
turbokid_reload.patch
added
TurboKid? patch for reload mechanism
comment:2 Changed 5 years ago by chrisz
I have created the patch with TSVN which used CRLF instead of LF for the control lines though the file uses LFs only. I don't think that should cause any problems, but I have uploaded again with CRLFs converted to LFs. The 5 spaces are an artifact of the patch program which adds the first column, the actual code uses only 4 spaces. If you click on the patch link above, you will see that trac can apply the patch, so it should be ok.
Changed 5 years ago by chrisz
-
attachment
turbokid_reload_and_filter.patch
added
TurboKid? patch for reload mechanism and i18n filter
please check out your editor's config it has some mix of CRLF and LF, also there are some lines with 5 spaces. I'm not sure if that's from the original code.
I'll add this to my TODO list.