Jump to content

[SOLVED}] Invalid Security Token


Guest

Recommended Posts

Any one else experiencing this?

 

When i add a module to the Quick Access system and then try the link I get this message

 

"Invalid Security token" then the message to get me out of here, or continue. NEither work

post-246958-0-55684900-1350067584_thumb.png

 

I have tried with and without Http, with and without thee actual token. I have tried deleting cache

 

. Seems this happens on some modules but not others.

 

Any ideas?

 

BTW the links work jsut fine when copied and pasted into the address bar

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

I've been testing out the RMA functionality and just received the same message when I deleted an item from an RMA request. I clicked the option to continue and Prestashop did what I requested, but this is awfully obnoxious and odd.

 

Any others have this problem?

Link to comment
Share on other sites

  • 4 weeks later...

I get the same error when trying to add modules to the drop down menus. I have tried adding the module controller etc into the 'Class' field as I read in another post.

eg adminmodules&configure=blockcontactinfos

 

But still get this security token error

Link to comment
Share on other sites

  • 1 month later...

Ok here's how to fix this one.

When entering the url you need to change the adminmodules part to AdminModules or adminstats to AdminStats, so the url looks something like this.

 

index.php?controller=AdminModules&configure=editorial

instead of

index.php?controller=adminmodules&configure=editorial

 

That seems to fix it for me.

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

Ok here's how to fix this one.

When entering the url you need to change the adminmodules part to AdminModules or adminstats to AdminStats, so the url looks something like this.

 

index.php?controller=AdminModules&configure=editorial

instead of

index.php?controller=adminmodules&configure=editorial

 

That seems to fix it for me.

 

Indeed same here , yet i don't know if we can consider this as bug or not ? if yes how can we report this ?

Link to comment
Share on other sites

  • 1 month later...
  • 4 months later...
  • 3 months later...
  • 11 months later...

Just encounter the same issue in PrestaShop version: 1.6.0.9. while trying to add a CMS page

 

Found the error in this module  /prestashop/controllers/admin/AdminCmsController.php

 

This line had incorrect code:

 

before:   note the "&"  vs "&"  looks like a copy and paste issue

href' => self::$currentIndex.'&add'.$this->table.'&id_cms_category='.(int)$this->id_cms_category.'&token='.$this->token

 

after:
href' => self::$currentIndex.'&add'.$this->table.'&id_cms_category='.(int)$this->id_cms_category.'&token='.$this->token

 

Moderator - please correct for future downloads

  • Like 14
Link to comment
Share on other sites

Just encounter the same issue in PrestaShop version: 1.6.0.9. while trying to add a CMS page

 

Found the error in this module  /prestashop/controllers/admin/AdminCmsController.php

 

Good work CharlieA -- this fixed it for me as well. Please suggest fixes to Github

Link to comment
Share on other sites

  • 4 weeks later...

Just encounter the same issue in PrestaShop version: 1.6.0.9. while trying to add a CMS page

 

Found the error in this module  /prestashop/controllers/admin/AdminCmsController.php

 

This line had incorrect code:

 

before:   note the "&"  vs "&"  looks like a copy and paste issue

href' => self::$currentIndex.'&add'.$this->table.'&id_cms_category='.(int)$this->id_cms_category.'&token='.$this->token

 

after:

href' => self::$currentIndex.'&add'.$this->table.'&id_cms_category='.(int)$this->id_cms_category.'&token='.$this->token

 

Moderator - please correct for future downloads

I tested of 1.6.0.9 it's perfect :D thank you

Link to comment
Share on other sites

Just encounter the same issue in PrestaShop version: 1.6.0.9. while trying to add a CMS page

 

Found the error in this module  /prestashop/controllers/admin/AdminCmsController.php

 

This line had incorrect code:

 

before:   note the "&"  vs "&"  looks like a copy and paste issue

href' => self::$currentIndex.'&add'.$this->table.'&id_cms_category='.(int)$this->id_cms_category.'&token='.$this->token

 

after:

href' => self::$currentIndex.'&add'.$this->table.'&id_cms_category='.(int)$this->id_cms_category.'&token='.$this->token

 

Moderator - please correct for future downloads

 

This did the trick for me! 

 

Isn't it bizarre however, that this problem exists over two years? Multiple versions and upgrades have been launched since, but they do not bother to solve this? WHile it is such a simple solution.

 

This is one of those things which make me doubt Prestashop. They just don't take their clients seriously. It's a shame, but I won't do any projects with it anymore...  :angry:

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

Just encounter the same issue in PrestaShop version: 1.6.0.9. while trying to add a CMS page

 

Found the error in this module  /prestashop/controllers/admin/AdminCmsController.php

 

This line had incorrect code:

 

before:   note the "&"  vs "&"  looks like a copy and paste issue

href' => self::$currentIndex.'&add'.$this->table.'&id_cms_category='.(int)$this->id_cms_category.'&token='.$this->token

 

after:

href' => self::$currentIndex.'&add'.$this->table.'&id_cms_category='.(int)$this->id_cms_category.'&token='.$this->token

 

Moderator - please correct for future downloads

Works for me too. Great Job Charlie  :D

Link to comment
Share on other sites

I was a bit to quick....  :(

 

Now it opens the page again. but when i want to save the new or modified cms page it goes back to the listing page without saving. When i choose 'save and view' i get a page with article not found.

 

My version is 1.6.0.9

 

Has anyone a solution or encountred the same problem?

Link to comment
Share on other sites

I was a bit to quick....  :(

 

Now it opens the page again. but when i want to save the new or modified cms page it goes back to the listing page without saving. When i choose 'save and view' i get a page with article not found.

 

My version is 1.6.0.9

 

Has anyone a solution or encountred the same problem?

 

When i set debug mode 'on' and i want to change something in CMS i'll get this message:

 

[PrestaShopDatabaseException]

Unknown column 'a.hide' in 'where clause'

 

SELECT a.`id_ps_advice`, a.`selector`, a.`location`, al.`html`, a.`weight`

FROM `ps_advice` a

 

            LEFT JOIN `ps_advice_lang` al ON al.`id_advice` = a.`id_advice`

            LEFT JOIN `ps_tab_advice` at ON at.`id_advice` = a.`id_advice`

WHERE (

            a.`validated` = 1 AND

            a.`hide` = 0 AND

            al.`id_lang` = 1 AND

            at.`id_tab` = 3 AND

            ((a.`start_day` = 0 AND a.`stop_day` = 0) OR (26 >= a.`start_day` AND 26 <= a.`stop_day`)))

 

at line 635 in file classes/db/Db.php

 

629.             WebserviceRequest::getInstance()->setError(500, '
 '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);

630.         }

631.         else if (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS'))

632.         {

633.             if ($sql)

634.                 throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');

635.             throw new PrestaShopDatabaseException($this->getMsgError());

636.         }

637.     }

638.

639.     /**

Link to comment
Share on other sites

  • 2 weeks later...

Just encounter the same issue in PrestaShop version: 1.6.0.9. while trying to add a CMS page

 

Found the error in this module  /prestashop/controllers/admin/AdminCmsController.php

 

This line had incorrect code:

 

before:   note the "&"  vs "&"  looks like a copy and paste issue

href' => self::$currentIndex.'&add'.$this->table.'&id_cms_category='.(int)$this->id_cms_category.'&token='.$this->token

 

after:

href' => self::$currentIndex.'&add'.$this->table.'&id_cms_category='.(int)$this->id_cms_category.'&token='.$this->token

 

Moderator - please correct for future downloads

Thanks, works without any problems!

  • Like 2
Link to comment
Share on other sites

Just encounter the same issue in PrestaShop version: 1.6.0.9. while trying to add a CMS page

 

Found the error in this module  /prestashop/controllers/admin/AdminCmsController.php

 

This line had incorrect code:

 

before:   note the "&"  vs "&"  looks like a copy and paste issue

href' => self::$currentIndex.'&add'.$this->table.'&id_cms_category='.(int)$this->id_cms_category.'&token='.$this->token

 

after:

href' => self::$currentIndex.'&add'.$this->table.'&id_cms_category='.(int)$this->id_cms_category.'&token='.$this->token

 

Moderator - please correct for future downloads

 

This did work as a charm!

  • Like 1
Link to comment
Share on other sites

 

When i set debug mode 'on' and i want to change something in CMS i'll get this message:

 

[PrestaShopDatabaseException]

Unknown column 'a.hide' in 'where clause'

 

SELECT a.`id_ps_advice`, a.`selector`, a.`location`, al.`html`, a.`weight`

FROM `ps_advice` a

 

            LEFT JOIN `ps_advice_lang` al ON al.`id_advice` = a.`id_advice`

            LEFT JOIN `ps_tab_advice` at ON at.`id_advice` = a.`id_advice`

WHERE (

            a.`validated` = 1 AND

            a.`hide` = 0 AND

            al.`id_lang` = 1 AND

            at.`id_tab` = 3 AND

            ((a.`start_day` = 0 AND a.`stop_day` = 0) OR (26 >= a.`start_day` AND 26 <= a.`stop_day`)))

 

at line 635 in file classes/db/Db.php

 

629.             WebserviceRequest::getInstance()->setError(500, '
 '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);

630.         }

631.         else if (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS'))

632.         {

633.             if ($sql)

634.                 throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');

635.             throw new PrestaShopDatabaseException($this->getMsgError());

636.         }

637.     }

638.

639.     /**

 

For some strange reason i missed some columns in my database  :unsure:.

Link to comment
Share on other sites

Just encounter the same issue in PrestaShop version: 1.6.0.9. while trying to add a CMS page

 

Found the error in this module  /prestashop/controllers/admin/AdminCmsController.php

 

This line had incorrect code:

 

before:   note the "&"  vs "&"  looks like a copy and paste issue

href' => self::$currentIndex.'&add'.$this->table.'&id_cms_category='.(int)$this->id_cms_category.'&token='.$this->token

 

after:

href' => self::$currentIndex.'&add'.$this->table.'&id_cms_category='.(int)$this->id_cms_category.'&token='.$this->token

 

Moderator - please correct for future downloads

 

Just encounter the same issue in PrestaShop version: 1.6.0.9. while trying to add a CMS page

 

Found the error in this module  /prestashop/controllers/admin/AdminCmsController.php

 

This line had incorrect code:

 

before:   note the "&"  vs "&"  looks like a copy and paste issue

href' => self::$currentIndex.'&add'.$this->table.'&id_cms_category='.(int)$this->id_cms_category.'&token='.$this->token

 

after:

href' => self::$currentIndex.'&add'.$this->table.'&id_cms_category='.(int)$this->id_cms_category.'&token='.$this->token

 

Moderator - please correct for future downloads

 

Thanks! It fixed for 1.6.0.9!

Link to comment
Share on other sites

Just encounter the same issue in PrestaShop version: 1.6.0.9. while trying to add a CMS page

 

Found the error in this module  /prestashop/controllers/admin/AdminCmsController.php

 

This line had incorrect code:

 

before:   note the "&"  vs "&"  looks like a copy and paste issue

href' => self::$currentIndex.'&add'.$this->table.'&id_cms_category='.(int)$this->id_cms_category.'&token='.$this->token

 

after:

href' => self::$currentIndex.'&add'.$this->table.'&id_cms_category='.(int)$this->id_cms_category.'&token='.$this->token

 

Moderator - please correct for future downloads

 You Rock! Life saver is what ye are :D

Link to comment
Share on other sites

  • 2 weeks later...

Just encounter the same issue in PrestaShop version: 1.6.0.9. while trying to add a CMS page

 

Found the error in this module  /prestashop/controllers/admin/AdminCmsController.php

 

This line had incorrect code:

 

before:   note the "&"  vs "&"  looks like a copy and paste issue

href' => self::$currentIndex.'&add'.$this->table.'&id_cms_category='.(int)$this->id_cms_category.'&token='.$this->token

 

after:

href' => self::$currentIndex.'&add'.$this->table.'&id_cms_category='.(int)$this->id_cms_category.'&token='.$this->token

 

Moderator - please correct for future downloads

I can confirm that your fix worked for me too. I'm using PS 1.6.0.9

 

Thanks.

Link to comment
Share on other sites

  • 3 weeks later...

Hi...

 

I fixed the issue with CMS with this fix...

 

However I realized that I also have the problem of the invalid token when trying to export customer's CSV file from the newsletter block module.

 

When copy/paste the url from the "export" button I can see this:

 

 

mysite.com/xxxxxx/index.php?controller=AdminModules&configure=blocknewsletter&amp;exportSubscribers&amp;token=xxxxxxxxx

 

 

If I delete the red caracthers and copy paste it on the browser, then it generates the CSV.

 

Is there any way to fix that to avoid manual deleting of amp; each time I have to export the file? thanks

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

@René Kuenen

 

Maybe that can help you.

 

I see Inside PS 1.6.0.9

 

.\controllers\admin :

 

AdminCmsCategoriesController.php (on line 83) :

$this->toolbar_btn['new']['href'] .= '&id_parent='.(int)Tools::getValue('id_cms_category');

AdminRequestSqlController.php (on line 96) :

'href' => self::$currentIndex.'&updaterequest_sql&token='.$this->token.'&id_request_sql='.(int)$id_request,

I use PS 1.6.0.6 and many files needs to be changed from & to &

 

Friendly

Link to comment
Share on other sites

  • 2 months later...

Just encounter the same issue in PrestaShop version: 1.6.0.9. while trying to add a CMS page

 

Found the error in this module  /prestashop/controllers/admin/AdminCmsController.php

 

This line had incorrect code:

 

before:   note the "&"  vs "&"  looks like a copy and paste issue

href' => self::$currentIndex.'&add'.$this->table.'&id_cms_category='.(int)$this->id_cms_category.'&token='.$this->token

 

after:

href' => self::$currentIndex.'&add'.$this->table.'&id_cms_category='.(int)$this->id_cms_category.'&token='.$this->token

 

Moderator - please correct for future downloads

Worked like a charm...thank you so much!

Link to comment
Share on other sites

  • 2 weeks later...

Just encounter the same issue in PrestaShop version: 1.6.0.9. while trying to add a CMS page

 

Found the error in this module  /prestashop/controllers/admin/AdminCmsController.php

 

This line had incorrect code:

 

before:   note the "&"  vs "&"  looks like a copy and paste issue

href' => self::$currentIndex.'&add'.$this->table.'&id_cms_category='.(int)$this->id_cms_category.'&token='.$this->token

 

after:

href' => self::$currentIndex.'&add'.$this->table.'&id_cms_category='.(int)$this->id_cms_category.'&token='.$this->token

 

 

 

Moderator - please correct for future downloadsAlso solved my problem with CMS new page in 1.6.0.9

Link to comment
Share on other sites

  • 3 months later...
  • 3 months later...

streetstylestore/admin2014/index.php?controller=Adminapilinks&token=5621b3937c344b6d6408745719a88438

 

this ins the url of my newly created controller , but the problem is with with its access token 

 

it says the token is invalid

 

here is my controller code

 

<?php
 
class AdminApilinksController extends AdminController {
 
public function __construct()
{
parent::__construct();
}
 
public function initContent()
{
parent::initContent();
echo "database";
die;
$this->setTemplate(_PS_THEME_DIR_.'mypage.tpl');
}
 
}
 
i am using prestashop 1.5
 
any help please ?
Link to comment
Share on other sites

  • 4 weeks later...

II also encountered this problem, try to solve it,Then I found the causes of this problem.

If you encounter this problem, please complete the following steps to check:

step1.Whether to use a standard method naming convention

For example:

                   your module name is mymod,but you admin tab class name is AdminMymodclassnameController,

"

Invalid Security Token

"

will be show.

now,You only need change "AdminMymodclassnameController" to "AdminmymodclassnameController",Problems will be solved

Link to comment
Share on other sites

  • 1 month later...

 Hello forumreaders,

I run PS V 1.6.1.1 and have the follow problem, only for these:

/index.php?controller=AdminModules&token=76c2a3cdefca73....

When I click on the Modules --> Modules & Services in BO.

Even if I change the Capitals..

I receive a blank page.

Try to disable Non Prestashop modules and so on, nothing change.

Someone a solution for this problem?

 

Best Regards,

Generaal

Link to comment
Share on other sites

×
×
  • Create New...