Page 2 of 2

Re: CGStaticMaps - No image

Posted: Thu Apr 07, 2016 9:46 am
by naturelab
So, you're saying the file 'cgecrf_b1e8aa2120810f4365f90d39453c612f' does exist. It has NO file extension.
Correct :)

I will look at the .htaccessfile
Thanks

Re: CGStaticMaps - No image

Posted: Thu Apr 07, 2016 9:47 am
by velden
naturelab wrote:
So, you're saying the file 'cgecrf_b1e8aa2120810f4365f90d39453c612f' does exist. It has NO file extension.
Correct :)

I will look at the .htaccessfile
Thanks
Note that multiple .htaccess files may apply (follow the path)

Re: CGStaticMaps - No image

Posted: Thu Apr 07, 2016 10:33 am
by PinkElephant
velden wrote:
PinkElephant wrote:

Code: Select all

$config['tmp_cache_location']       = '/srv/example.com/public/private/cmsms/tmp/cache';
... and will 404 as cgecrf_b1e8aa2120810f4365f90d39453c612f lives in the non world-readable location set in config.php
That location is/must be world-readable. E.g. combined css files are stored there and called directly by browser.
Aiui, the var allows protection of files that don't need to be world-readable - mainly *.cms, while *.js and *.css are still served from the default world-readable tmp/cache.
CMSMS_config_reference.pdf wrote:tmp_cache_location
This config variable allows specifying a secure location where CMSMS can write files that should not necessarily be web browseable.
You must specify an absolute directory that is writable by the php process.
The module is writing to the world-unreadable location but it turns out that this isn't relevant to naturelab's setup.

I need to do more testing as I'm seeing (transitional) errors when using the default cache location. "Problem retrieving google map to store statically", etc ...

Re: CGStaticMaps - No image

Posted: Thu Apr 07, 2016 12:48 pm
by PinkElephant
[update] After Clearing the Cache - and going into Maintenance Mode a few times - it's mostly working as expected with the default cache location. For example;

Code: Select all

{CGStaticMaps center='Amsterdam NL' marker0='Paris FR' marker1='Amsterdam NL' markercolor='#efefef' size='750x750'}
outputs a suitably sized and labelled map with;

Code: Select all

<img id="" class="" alt="Paris FR" width="" height="" src="https://www.example.com/cmsms/tmp/cache/cgecrf_0109491e7b12f62a652988a4912fd304"/>
Hmmm, removing the size parameter generates an error:

Code: Select all

Error: at line 34 in file /srv/example.com/public/htdocs/cmsms/modules/CGStaticMaps/lib/class.saved_static_map.php:
Message: Problem retrieving google map to store statically
... and no amount of cache clearing/maintenance mode and tag edits are clearing it.

trace info:

Code: Select all

#0 /srv/example.com/public/htdocs/cmsms/modules/CGStaticMaps/action.default.php(56): CGStaticMaps\saved_static_map->get_url()
#1 /srv/example.com/public/htdocs/cmsms/lib/classes/class.CMSModule.php(1409): include('/srv/example.co...')
#2 /srv/example.com/public/htdocs/cmsms/modules/CGExtensions/CGExtensions.module.php(693): CMSModule->DoAction('default', 'm9dd5b', Array, '33')
#3 /srv/example.com/public/htdocs/cmsms/lib/classes/class.CMSModule.php(1476): CGExtensions->DoAction('default', 'm9dd5b', Array, '33')
#4 /srv/example.com/public/htdocs/cmsms/lib/module.functions.php(105): CMSModule->DoActionBase('default', 'm9dd5b', Array, '33', Object(Smarty_Internal_Template))
#5 /srv/example.com/public/htdocs/cmsms/lib/classes/class.CMSModule.php(270): cms_module_plugin(Array, Object(Smarty_Internal_Template))
#6 /srv/example.com/public/htdocs/cmsms/lib/smarty/sysplugins/smarty_internal_templatebase.php(151) : eval()'d code(34): CMSModule::function_plugin(Array, Object(Smarty_Internal_Template))
#7 /srv/example.com/public/htdocs/cmsms/lib/smarty/sysplugins/smarty_internal_templatebase.php(182): content_570652f5c02fb0_05328951(Object(Smarty_Internal_Template))
#8 /srv/example.com/public/htdocs/cmsms/lib/classes/internal/class.CMS_Content_Block.php(290): Smarty_Internal_TemplateBase->fetch('content:content...', '|content_en', '33content_en')
#9 /srv/example.com/public/htdocs/cmsms/lib/smarty/sysplugins/smarty_internal_templatebase.php(151) : eval()'d code(40): CMS_Content_Block::smarty_internal_fetch_contentblock(Array, Object(Smarty_Internal_Template))
#10 /srv/example.com/public/htdocs/cmsms/lib/smarty/sysplugins/smarty_internal_templatebase.php(182): content_570652f5b36e91_90154785(Object(Smarty_Internal_Template))
#11 /srv/example.com/public/htdocs/cmsms/index.php(160): Smarty_Internal_TemplateBase->fetch()
#12 {main}
Afaics, at the time of the errors the png file doesn't exist in the cache. Not sure what's happening here but maybe a timeout needs to occur before a new map is generated...