Piwigo Bugtracker

Piwigo bug tracker has moved to Github

This bugtracker is kept to provide history on old issues.

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000893Piwigowarningspublic2008.10.14 12:492008.10.15 06:51
Assigned Torub 
PlatformOSOS Version
Product Version2.0.0RC2 
Target VersionFixed in Version2.0.0RC4 
Summary0000893: 404 errors on template-common/lib/ui/i18n/ui.datepicker-en.js
Descriptionthis file does not exist, but there is an attempt to load on every hit ...
TagsNo tags attached.
Database engine and version
PHP version
Web serverApache 1.3.x
Attached Files

- Relationships

-  Notes
rub (developer)
2008.10.14 14:02

I thought that the function known_script check if file exists.

I can to add a ui.datepicker-en.js but it's not product by jQuery. And that not fix issue for other languages.

I can modify function known_script, if file don't exist script are not included.
I can add $params['check_exist'] by default true in order to check the existence of file.
rvelices (developer)
2008.10.14 15:24

The problem is that src is an url, not a path, so if you're using question_marks_in_url=false, then it will not work. Also it's going to be slow if full urls are used ...

What about: {if $lang_info.code!='en'}...{/if}
rub (developer)
2008.10.14 16:35

I wanted only check exist file with relative src path...
But with full path (http on other site for example) we can be have pb.

I will follow your advise and use {if $lang_info.code == 'fr' || $lang_info.code == 'etc'...}...{/if}.
There are not operator "in" with smarty?
rvelices (developer)
2008.10.14 18:27

no there is no in operator in smarty... anyway given the number of translations in datepicker compared to ours, we could start with a simple test !='en'
rub (developer)
2008.10.14 19:08

Or I can do a replace of en to uk?

Like $$lang_info.code|replace:'en':'uk'
rub (developer)
2008.10.14 22:40

A fix like [Subversion] r2739 is correct for you?
rvelices (developer)
2008.10.14 22:59

$filename = get_root_url()."tem .....

is not really good... root_url is an url not a path... I'd rather use ROOT_PATH for file_exists and get_root_url for script src=...

not sure what the others will think about putting direct php in the templates... I never used it just to keep the separation clear, but why not ... (as long as we dont set the secutity settings in php ...)
rub (developer)
2008.10.14 23:10

> not sure what the others will think about putting direct php in the templates...
Yes, me too, I am not sure that will be the good solution.

I'd rather really do the file_exists on know_script function.
Pat (developer)
2008.10.14 23:16
edited on: 2008.10.14 23:17

Sinon, tout simplement:

{if $ROOT_URL|@cat:"template-common/lib/ui/i18n/ui.datepicker-"|@cat:$lang_info.code|@cat:".js"|@file_exists}
{known_script id="jquery.ui.datepicker-$lang_info.code" src=$ROOT_URL|@cat:"template-common/lib/ui/i18n/ui.datepicker-"|@cat:$lang_info.code|@cat:".js"}

PS: je viens de vérifier, ca fonctionne impec.

Pat (developer)
2008.10.14 23:26

En un poil plus clair, ca donne:

{assign var="datepicker_language" value=$ROOT_URL|@cat:"template-common/lib/ui/i18n/ui.datepicker-"|@cat:$lang_info.code|@cat:".js"}

{if $datepicker_language|@file_exists}
{known_script id="jquery.ui.datepicker-$lang_info.code" src=$datepicker_language}
rvelices (developer)
2008.10.14 23:30

ca fonctionne en admin mais pas sur picture ou index si conf['question_mark_in_urls']=false
rub (developer)
2008.10.15 00:43

J'aime bien l'idée de P@t, je ne savais pas qu'on pouvait utiliser n'importe quelle fonction php.

Pour avoir le path et l'url, il suffit de faire:

{assign var="datepicker_language" value="template-common/lib/ui/i18n/ui.datepicker-"|@cat:$lang_info.code|@cat:".js"}

{if "PHPWG_ROOT_PATH"|@constant|@cat:$datepicker_language|@file_exists}
{known_script id="jquery.ui.datepicker-$lang_info.code" src=$ROOT_URL|@cat:$datepicker_language}

C'est ok pour vous comme ca?
rvelices (developer)
2008.10.15 00:47

ca m'a lair bon ... si @constant ca marche ...
rub (developer)
2008.10.15 06:50

@constant fonctionne et affiche ./ ;-)
rub (developer)
2008.10.15 06:51

[Subversion] r2743 & [Subversion] r2744

- Issue History
Date Modified Username Field Change
2008.10.14 12:49 rvelices New Issue
2008.10.14 12:49 rvelices Status new => assigned
2008.10.14 12:49 rvelices Assigned To => rub
2008.10.14 12:49 rvelices browser => any
2008.10.14 12:49 rvelices Web server => Apache 1.3.x
2008.10.14 14:02 rub Note Added: 0002427
2008.10.14 15:24 rvelices Note Added: 0002428
2008.10.14 16:35 rub Note Added: 0002429
2008.10.14 18:27 rvelices Note Added: 0002430
2008.10.14 19:08 rub Note Added: 0002431
2008.10.14 22:40 rub Note Added: 0002432
2008.10.14 22:59 rvelices Note Added: 0002433
2008.10.14 23:10 rub Note Added: 0002434
2008.10.14 23:16 Pat Note Added: 0002435
2008.10.14 23:17 Pat Note Edited: 0002435
2008.10.14 23:26 Pat Note Added: 0002436
2008.10.14 23:30 rvelices Note Added: 0002437
2008.10.15 00:43 rub Note Added: 0002438
2008.10.15 00:47 rvelices Note Added: 0002439
2008.10.15 06:50 rub Note Added: 0002440
2008.10.15 06:51 rub Status assigned => closed
2008.10.15 06:51 rub Note Added: 0002441
2008.10.15 06:51 rub Resolution open => fixed
2008.10.15 06:51 rub Fixed in Version => 2.0.0RC4

Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker