Jump to content

Rebuild layered_friendly_url table [SOLVED]


promatik

Recommended Posts

My store has a bug, when I share a link with a sub-category selected like:
http://goodafter.com/21-mercearia#/categorias-pequeno_almoco

The subcategory disappear, and the url turns to: http://goodafter.com/21-mercearia#

 

After an extensive debug I found the problem comes from an empty table ps_layered_friendly_url.

The call is in the file blocklayered.php, function getSelectedFilters().

 

Is there any way to rebuild this table?

I don't know what happened here, I don't believe I've truncated it.

Edited by promatik (see edit history)
Link to comment
Share on other sites

Have you tried clicking the "Build URL index" button on the configuration page of the "Layered Navigation block"? If that doesn't work, I guess you'll have to reset the module and then reconfigure it again.

  • Like 1
Link to comment
Share on other sites

  • 2 months later...

Same problem but I found another solution :

 

Problem : 

 

Table 'database.ps_layered_friendly_url' doesn't exist
Table 'database.ps_layered_product_attribute' doesn't exist
 
[PrestaShopDatabaseException]

Table 'database.ps_layered_friendly_url' doesn't exist
 

SELECT data FROM `ps_layered_friendly_url` WHERE `url_key` = '1196b52362647d9d04cc81eb54e5d50b' LIMIT 1
at line 646 in file classes/db/Db.php

 

641.             WebserviceRequest::getInstance()->setError(500, '
 '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);
642.         }
643.         elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS'))
644.         {
645.             if ($sql)
646.                 throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');
647.             throw new PrestaShopDatabaseException($this->getMsgError());
648.         }
649.     }
650.
651.     /**
 
Solution :
 
1. Connect to MySQL :
mysql database -u root -p
 
2. Check if tables are in MySQL index :
SHOW TABLES;
> … | ps_layered_friendly_url | ps_layered_product_attribute | …
 
3. Check tables doesn't exists :
select * from ps_layered_friendly_url;
select * from ps_layered_product_attribute;
> ERROR 1146 (42S02): Table 'database.ps_layered_friendly_url' doesn't exist
> ERROR 1146 (42S02): Table 'database.ps_layered_product_attribute' doesn't exist
 
4. Create an SQL file containing sql requests (create + complete) of this 2 tables from the last valid SQL dump
 
5. Upload this file on server and add it to database (and check again if tables exists) :
mysql database -u root -p < /tmp/fichier.sql
 
6. If ok, in Prestashop, go to :
MODULES > BLOCKLAYERED > SETTINGS > Index all tabs
 
If 4 tabs are indexed without errors, it's the right way, check your website, you mustn't find any error !
Edited by Klemart3D (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...