Ultimate SEO Urls

Clicking product in search result error with accented letter - Ultimate SEO Urls

Clicking product in search result error with accented letter

by artfulweb » Wed Mar 15, 2023 12:24 pm

Hi, Thanks for the update however when clicking a product shown in a language with accented letters it gives a 400 error and this is in the navigator (product has "écharpe" in keywords):

https://www.XXX.com/fam-225-45-echarpe- ... pe&sort=1a
artfulweb
VIP Member
VIP Member
Posts: 119
Joined: Thu Oct 29, 2020 12:34 pm
Contact:

Re: Clicking product in search result error with accented le

by Piernas » Wed Mar 15, 2023 7:56 pm

Can you please change line 140 of includes/apps/ultimate_seo_urls/abstracts/page_modules.php
from

Code: Select all

      return htmlspecialchars( utf8_encode( $link ) );
to

Code: Select all

      return htmlspecialchars(  $link  );
and theck if it is fixed?

EDIT: It doesn't fix it. I'll keep checking.
Piernas
Posts: 96
Joined: Thu Mar 11, 2021 2:16 am
Contact:

Re: Clicking product in search result error with accented le

by artfulweb » Wed Mar 15, 2023 9:55 pm

Piernas wrote:Can you please change line 140 of includes/apps/ultimate_seo_urls/abstracts/page_modules.php
from

Code: Select all

      return htmlspecialchars( utf8_encode( $link ) );
to

Code: Select all

      return htmlspecialchars(  $link  );
and theck if it is fixed?

EDIT: It doesn't fix it. I'll keep checking.
Unfortunately now there are no search results at all!

So in doubt I started fresh and reuploaded the latest version and now can not get into admin and have seen these errors in the log files (same if French or English):

PHP Warning: SQLite3::query(): Unable to prepare statement: 11, database disk image is malformed in /xx/xx/xx/catalog/includes/apps/ultimate_seo_urls/main/usu_main.php on line 333
[15-Mar-2023 22:35:14 Europe/Paris] PHP Fatal error: Uncaught Error: Call to a member function fetchArray() on bool in /xx/xx/xx/catalog/includes/apps/ultimate_seo_urls/main/usu_main.php:334
Stack trace:
#0 /xx/xx/xx/catalog/includes/apps/ultimate_seo_urls/cache_system/sqlite.php(150): usu_Main->extractCacheData('1_http_error', 'sqlite', Object(Sqlite_Cache_Module))
#1 /xx/xx/xx/catalog/includes/apps/ultimate_seo_urls/main/bootstrap.php(76): Sqlite_Cache_Module->retrieve()
#2 /xx/xx/xx/catalog/includes/apps/ultimate_seo_urls/main/usu_main.php(106): usu_Bootstrap->bootStrapper(Array)
#3 /xx/xx/xx/catalog/includes/classes/usu_init.php(41): usu_Main->initiate(Array, '2', 'english')
#4 /xx/xx/xx/catalog/includes/system/versioned/1.0.8.1/hooks.php(160): usu_init::i(Array)
#5 /xx/xx/xx/catalog/includes/application_top.php(30): hooks->generate('startApplicatio...')
#6 /xx/xx/xx/catalog/http_error.php(13): require('/homepages/35/d...')
#7 {main}
thrown in /xx/xx/xx/catalog/includes/apps/ultimate_seo_urls/main/usu_main.php on line 334
[15-Mar-2023 22:35:16 Europe/Paris] PHP Fatal error: Uncaught Error: Undefined constant "SID" in /xx/xx/xx/catalog/includes/classes/usu_init.php:36
Stack trace:
#0 /xx/xx/xx/catalog/includes/system/versioned/1.0.8.1/hooks.php(160): usu_init::i(Array)
#1 /xx/xx/xx/catalog/includes/application_top.php(30): hooks->generate('startApplicatio...')
#2 /xx/xx/xx/catalog/product_info.php(13): require('/homepages/35/d...')
#3 {main}
thrown in /xx/xx/xx/catalog/includes/classes/usu_init.php on line 36
artfulweb
VIP Member
VIP Member
Posts: 119
Joined: Thu Oct 29, 2020 12:34 pm
Contact:

Re: Clicking product in search result error with accented le

by Piernas » Thu Mar 16, 2023 12:06 am

It seems the addon has set sqlite3 as cache system for some reason (or the sqlite database got corrupted if you're using it); if you can access admin (I think you should be able to) just change the cache to file or slq - or deactivate it in the app options.

I think I've resolved the issue by removing the 'keyword' querystring from product page links:

Please revert previous change and in line 141 of includes\apps\ultimate_seo_urls\page_modules\product_info.php change the line to:

Code: Select all

      $extract =  ['cPath', 'manufacturers_id', 'sort', 'keywords']; // removes unneeded querystrings
This change will remove the added 'sort' and 'keywords' by category and search pages.

There is still a possible problem if any addon uses utf8 encoded accented characters in a querystring. It's not probable but I'll look at it in the future.
Last edited by Piernas on Thu Mar 16, 2023 12:14 am
Piernas
Posts: 96
Joined: Thu Mar 11, 2021 2:16 am
Contact:

Re: Clicking product in search result error with accented le

by Piernas » Thu Mar 16, 2023 12:11 am

I have checked and you won't be able to access admin. You'll have to acces the database with phpmyadmin and change manually the table configuration entry for USU_CACHE_SYSTEM to "file" and then access admin to change options as your preference.
Piernas
Posts: 96
Joined: Thu Mar 11, 2021 2:16 am
Contact:

Re: Clicking product in search result error with accented le

by artfulweb » Thu Mar 16, 2023 10:11 am

Piernas wrote:It seems the addon has set sqlite3 as cache system for some reason (or the sqlite database got corrupted if you're using it); if you can access admin (I think you should be able to) just change the cache to file or slq - or deactivate it in the app options.

I think I've resolved the issue by removing the 'keyword' querystring from product page links:

Please revert previous change and in line 141 of includes\apps\ultimate_seo_urls\page_modules\product_info.php change the line to:

Code: Select all

      $extract =  ['cPath', 'manufacturers_id', 'sort', 'keywords']; // removes unneeded querystrings
This change will remove the added 'sort' and 'keywords' by category and search pages.

There is still a possible problem if any addon uses utf8 encoded accented characters in a querystring. It's not probable but I'll look at it in the future.
That did it! Thanks so much.
artfulweb
VIP Member
VIP Member
Posts: 119
Joined: Thu Oct 29, 2020 12:34 pm
Contact: