fix for template_dir is array without key of zero defined #14
fix for template_dir is array without key of zero defined #14glensc merged 6 commits intosmarty-gettext:masterfrom timmit-nl:master
Conversation
…he first existing directory and take that path
…he same as the template dir
|
care to drop in some testcase? |
|
Hi Elan, Ehmmm good question, I never have done one propperly. But I will give it a try. |
|
Hi Elan, I have tried to update the testcases. Can you review it and if correct intergrate the pull request? Thanks, Tim |
|
looks like your last commit broke tests: i haven't looked closely in what you are doing there, but template_dir being string (not array) support must be retained. also to get first item from array regardless what it is, you can use current() php function |
|
Hi Elan, I have restored the The current() is not what I am looking for, because I want the first existing path, not the first template_dir. Hopefully you can see what I am doing in the TestCase.php. The test will now run OK |
|
Hi Elan, Sorry to bother you again. But did you have time to review this merge request? Thanks, Tim |
|
sorry, not yet |
|
Thanks! Can you also make a new release? |
|
yes. planned it 4 days ago, but got lost in sea of information again :D i got distracted when waiting for travis job to succeed. ayway. released now! |
Hi There,
I have written a fix for if the array contains diffrent keys then 0,1,2,3,4....
Before the locale function only pickes $template_dir[0]. Now the function will pick the first directory in order of the array if the template_dir is a directory including the params['path'].
Also have a fallback if the path is not defined, for example with stack="pop" (then the path is not necessary)
Please add it upstream so we can use the packagist packages.
Thanks,
Tim