[#9810] Don't put the path of FieldDef in database, Prefer caching

Created By: bess (bess)
Date Submitted: 2014-02-04 09:43

Assigned To: Tapio Löytty (Stikki)
Resolution: Fixed
State: Open
Don't put the path of FieldDef in database, Prefer caching
Detailed Description:
For a huge project (with different servers : production / integration / dev /...
)  with LoadBalancing, ReverseProxy and everything i used cmsms + listit with a
lot of pleasure (as usual, thanks guys..)

But if i code my work on windows, i need to put the SQL on an Unix environment
and obviously i need to rescan manually the fielddefinition each time i upgrade
an instance of cmsms on a plateforme.

At this point it's not a valid solution.

My first solution was to create a module ListIt2Industrializer and put
{ListIt2Industrializer} in each template. This module will search after a custom
file into /tmp/cache. If it's not found it will regenerate the
listfieldDefinition (ListIt2FielddefOperations::ScanModules()) and create its
custom file into /tmp/cache.

So i only need to clear the cache (manually or not) to fix the problem !

You can download my module on my website

A better (and quick solution) could be to do the same inside ListIt2 itself when
it's loaded.

The great solution should be to stop putting path into database and prefer a
cache file logique ;)

Thank you again for your great job and feel free to contact me if you need more


Date: 2014-02-04 10:17
Posted By: Tapio Löytty (Stikki)

But you can scan fielddefs in mother module fielddefs tab.

Why do you need these in file?
Date: 2014-02-04 18:23
Posted By: Tapio Löytty (Stikki)


git: listit2.git (rev:db06523f882ea4288020ab6463ea139ac2b0eeed) Stikki

Hooking module to ContentPostCompile event. With option allows autoscan based on
content compilation. Makes moving site to client location easier. Might cause
performance peak, so use with caution.
Date: 2014-02-04 18:25
Posted By: Tapio Löytty (Stikki)

So now you can trigger scanner by clearing template cache (tmp/templace_c)
Date: 2014-06-18 05:01
Posted By: Eric Pesser (heriquet)

I had the same question but not the same issue: when moving from dev environment
to prod environment, all fields def paths were wrong so that I had to use this
new autoscan option, but why not save all field def path without full path, but
using {root_path} relative path?

Thanks a lot for this module.
Date: 2014-06-18 05:04
Posted By: Tapio Löytty (Stikki)

Because fielddef path is not defined, i can be anywhere inside module. So i need
something to tell where main control file is.

And your welcome.

Updated: 2014-02-04 18:23
resolution_id: 5 => 7
assigned_to_id: 100 => 11306

Updated: 2014-02-04 10:17
resolution_id: => 5