Pages:

No template file

herman

Avatar: herman

2005-11-20 14:20

when i change a thing in the configuration.
and say save i get in the shop :

No template file : bla.tpl
and more of them what can that be ???

rtt

No avatar

2005-11-20 15:08

Have you modified the maps and files in db, files and config with chmod 777?

rtt

herman

Avatar: herman

2005-11-20 15:54

yes i mod the files to 777
also the files en db.

i also did it with the config.php .

glasgne

No avatar

2005-11-23 08:44

I have the same problem, with a clean and just downloaded installation. I get this when I'm surfing to the store:

No template file: templates/./products_list.tpl
No template file: templates/./products_list.tpl
No template file: templates/./content_list.tpl
No template file: templates/./content_list.tpl
No template file: templates/./content_list.tpl
No template file: templates/./content_list.tpl
No template file: templates/./content_list.tpl
No template file: templates/./content_list.tpl
No template file: templates/./head.tpl
No template file: templates/./footer.tpl

There is no template in the template dropdown in admin, just a dot.

This only happens after the general.php file is updated from admin.

(My Quickcart installation is in a specific directory. After install everything works fine. Everything that needs to be 777 is 777. I have installed Quickcart before, but this is freshly downloaded files - maybe some error in the zip?)

glasagne

No avatar

2005-11-24 11:16

Still stuck here!

wizzud

No avatar

2005-11-24 11:39

What version of QC are running?

glasagne

No avatar

2005-11-24 12:00

0.3.1 - downloaded several times just to make sure something didn't go wrong in the download.

I have installed that version before without issues, so I'm guessing something's wrong in the zip in the download area?

wizzud

No avatar

2005-11-24 13:06

There is a slight problem with one of the functions defined in core/preferences.php - throwTemplatesSelect().
It does a dir->read() through the templates folder and discards the first 2 entries it comes across, asuming that they will be the current directory (.) and the parent directory (..). However, the order in which directory entries are returned is system dependent so it is possible for these 2 entries to be returned AFTER other valid entries, which means they (the valid entries) get missed!

Edit core/preferences.php and find the code beginning on roughly line 37 ...

<?php
    
while( false !== ( $sDir $oDir->read( ) ) ){
      if( 
$lp >){
        if( 
is_dirTPL.$sDir ) && $sDir != 'admin' ){
          if( isset( 
$sDirName ) && $sDirName == $sDir.'/' )
            
$sSelected 'selected="selected"';
          else
            
$sSelected null;
            
          
$sOption .= '<option value="'.$sDir.'/" '.$sSelected.'>'.$sDir.'</option>';
        }
      }
      
$lp++;
    } 
// end while
?>


and replace it with ...

<?php
    
while( false !== ( $sDir $oDir->read( ) ) ){
/* commented out 2 lines ...
      if( $lp >1 ){
        if( is_dir( TPL.$sDir ) && $sDir != 'admin' ){
*/
// substitued 1 line ...
        
if( substr($sDir,0,1) != '.' && is_dirTPL.$sDir ) && $sDir != 'admin' ){
          if( isset( 
$sDirName ) && $sDirName == $sDir.'/' )
            
$sSelected 'selected="selected"';
          else
            
$sSelected null;
            
          
$sOption .= '<option value="'.$sDir.'/" '.$sSelected.'>'.$sDir.'</option>';
        }
/* commented out 2 lines ...
      }
      $lp++;
*/
    
// end while
?>



Please note: if you see '&amp;' anywhere in the above code it should be just a '&'!

glasgne

No avatar

2005-11-24 13:19

No good, and I can't reach the admin anymore either, just a blank page. I have my Quickcart installation in /store.

The code:

if( !function_exists'throwTemplatesSelect' ) ){
  
/**
  * Zwracanie selekta szablonow
  * @return string
  * @param string $sDirName
  */
  
function throwTemplatesSelect$sDirName null ){

    
$sOption =  null;
    
$oDir =     dirTPL );
    
$lp =       0;

    while( 
false !== ( $sDir $oDir->read( ) ) ){
/* commented out 2 lines ...
      if( $lp >1 ){
        if( is_dir( TPL.$sDir ) && $sDir != 'admin' ){
*/
// substitued 1 line ...
        
if( substr($sDir,0,1) != '.' && is_dirTPL.$sDir ) && $sDir != 'admin' ){
          if( isset( 
$sDirName ) && $sDirName == $sDir.'/' )
            
$sSelected 'selected="selected"';
          else
            
$sSelected null;

          
$sOption .= '<option value="'.$sDir.'/" '.$sSelected.'>'.$sDir.'</option>';
        }
/* commented out 2 lines ...
      }
      $lp++;
*/
    
// end while

    
$oDir->close( );

    return 
$sOption;
  } 
// end function throwTemplatesSelect
}



Correct?

wizzud

No avatar

2005-11-24 13:21

Well, its nearly right. Where you see '&quot;' it should be double quotes ("), and '&lt;' should be a less than (<).

wizzud

No avatar

2005-11-24 13:24

I can't seem to get this PHP code inserting stuff to consistently show what I want it show!

glasgne

No avatar

2005-11-24 14:07

They're a real pain! :P

Is this correct?

    while( false !== ( $sDir $oDir->;read( ) ) ){
/* commented out 2 lines ...
      if( $lp >1 ){
        if( is_dir( TPL.$sDir ) && $sDir != 'admin' ){
*/
// substitued 1 line ...
        
if( substr($sDir,0,1) != '.' && is_dirTPL.$sDir ) && $sDir != 'admin' ){
          if( isset( 
$sDirName ) && $sDirName == $sDir.'/' )
            
$sSelected 'selected="selected"';
          else
            
$sSelected null;

          
$sOption .= '<option value="'.$sDir.'/" '.$sSelected.'>'.$sDir.'</option>';
        }
/* commented out 2 lines ...
      }
      $lp++;
*/
    
// end while



It still doesn't work. :(

glasgne

No avatar

2005-11-24 14:08

Dammit, now I'm losing them. *grr*

Here's a text file:
http://www.teamgoodwill.se/prefs.txt

wizzud

No avatar

2005-11-24 15:00

Nearly.
You've got an unnecessary semi-colon in front of the read on the first line - should be ... $sDir = $oDir->read( ) ...

glasgne

No avatar

2005-11-24 16:06

Hey! Great! It's working and I can switch templates and everything. Thanks!

Another thing though: why can I only choose "en" as a language on the configuration page in admin? It works perfectly fine if I change the configuration in general.php (in a text editor), but "se" never shows up in admin which means that whenever I need to change something there the site goes back to "en". Any ideas?

wizzud

No avatar

2005-11-24 16:53

Its for the same reason.
The second-to-last function in the core/preferences.php file is throwLangSelect. It also uses a counter to skip past the first 2 entries retrieved from the directory, and is probably missing the other language file(s) as a consequence.

In that function, change

<?php
      
if( $i ){
        if( 
is_fileDIR_LANG.$sFile ) )
?>


to

<?php
/* commented out 2 lines ...
      if( $i > 1 ){
        if( is_file( DIR_LANG.$sFile ) )
*/
// substituted 1 line ...
        
if( substr($sFile,0,1) != '.' && is_fileDIR_LANG.$sFile ) )
?>



and change

<?php
      
}
      
$i++;
?>


to

<?php
/* commented out 2 lines ...
      }
      $i++;
*/
?>


glasgne

No avatar

2005-11-25 11:50

Works like a charm! Thanks a lot! :)

glasgne

No avatar

2005-11-25 11:53

Just installed the productAttributes plugin and I'm getting a blank page under "attributes" in admin (menu still there). Same thing in another place?

glasgne

No avatar

2005-11-25 12:30

Don't seem to be able to create products all the time either, just getting that blank page...

My guess is that there is a lot of places where these things need to be fixed. The question is: is it worth the effort? It's not so quick and easy anymore. :(

wizzud

No avatar

2005-11-25 20:24

Totally unrelated. Attributes doesn't need to read the contents of any folders!
Assuming that you're running productAttributes v1.x, check through the installation instructions carefully to make sure you haven't missed anything.( templates readable, db/attributes.php writable, correct link in head.tpl, etc, etc).

Pages:
Back to top
about us | contact