Jump to content

How to restore broken backend


MrTouch

Recommended Posts

I have an issue, where my the backend of my shop is somehow broken. I think it happend after I tried installing a free third party module. 

Orders which don't have a invoice or order form are displayed normal. but orders with it are displayed like in the file i added. somehow there is an error, that css and javascript and somhow other information don't load..

anyway, i found an old backup of the database. and now i would like to restore this order page from that backup. which tables should i overwrite?

What I dont want to touch are the customers, the orders and my products. It doesn't matter if I have to reinstall the modules and configure them again. But I cannot afford to lose the mentioned data. can anybody help me out?

 

thanks in advance!

 

issue_orders.thumb.JPG.da6990d1245c825ec143e3f930435055.JPG

Link to comment
Share on other sites

Hello:

Your problem is not in database. There is a module which is causing this problem. Go in your backoffice to the Modules Positions menu. Look for "DisplayAdminOrder" hook and one of the modules hooked there is the problematic. Then, just disable this module and all should be right.

If you want to solve the module problem then you should do what @Adeko.nl said.

Regards

Link to comment
Share on other sites

5 hours ago, Adeko.nl said:

Hi,

You have to active debug mode, this will tell you where and what goes wrong. If you post the error you get here we'll be happy to help.

Sorry but where can i activate debug mode? I googled it but I somehow don't have that option where it should be.

PrestaShop Dashboard > Advanced Parameters > Performance

debug mode.JPG

 

nvm. found it, had to change it in over the file system in the defines.inc.php

 

this is the error message:

 

Fatal error: Uncaught Error: Call to undefined method OrderInvoice::getDeliveryNumberFormatted() in /home/infoevim/www/carpethouse.ch/cache/smarty/compile/53/e9/b2/53e9b2f66d176a52924b9be1406208dddec4ef5d.file.view.tpl.php:2103 Stack trace: #0 /home/infoevim/www/carpethouse.ch/cache/smarty/compile/53/e9/b2/53e9b2f66d176a52924b9be1406208dddec4ef5d.file.view.tpl.php(425): content_5ccc10de4ca2c9_85963860(Object(Smarty_Custom_Template)) #1 /home/infoevim/www/carpethouse.ch/tools/smarty/sysplugins/smarty_internal_templatebase.php(188): content_5ccc10de74a0e1_27199453(Object(Smarty_Custom_Template)) #2 /home/infoevim/www/carpethouse.ch/classes/SmartyCustom.php(317): Smarty_Internal_TemplateBase->fetch(Object(Smarty_Custom_Template), NULL, NULL, NULL, false, true, false) #3 /home/infoevim/www/carpethouse.ch/classes/helper/Helper.php(113): Smarty_Custom_Template->fetch() #4 /home/infoevim/www/carpethouse.ch/classes/helper/HelperView.php(59): HelperCore->generate() #5 /home/infoevim/www/carpethouse.ch/classes/controller/AdminContr in/home/infoevim/www/carpethouse.ch/cache/smarty/compile/53/e9/b2/53e9b2f66d176a52924b9be1406208dddec4ef5d.file.view.tpl.php on line 2103

Edited by MrTouch
found the solution to the question and added the following question. (see edit history)
Link to comment
Share on other sites

De-activating modules is not always enough. Sometimes you need to totally remove them. 

So:

 - Delete this module that you suspect and make sure that it is no longer there in the modules directory.

 - if that doesn't help it might be that it left an override. So check for that. You can do it manually (probably orderinvoice.php is overridden) Or you can use Prestools for that.

 - make sure to empty your cache after each change.

Link to comment
Share on other sites

55 minutes ago, musicmaster said:

De-activating modules is not always enough. Sometimes you need to totally remove them. 

 So:

 - Delete this module that you suspect and make sure that it is no longer there in the modules directory.

  - if that doesn't help it might be that it left an override. So check for that. You can do it manually (probably orderinvoice.php is overridden) Or you can use Prestools for that.

  - make sure to empty your cache after each change.

I deleted and removed both modules which behaved strange. and deleted the cache. but it didn't help.

So do i have to delete the orderinvoice.php file in this folder: modules\ba_prestashop_invoice\override\classes\order\orderinvoice.php ? 

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

2 minutes ago, MrTouch said:

I deleted and removed both modules which behaved strange. and deleted the cache. but it didn't help.

So do i have to delete the orderinvoice.php file in this folder: modules\ba_prestashop_invoice\override\classes\order\orderinvoice.php ? 

You give a strange interpretation of my words. If ba_prestashop_invoice is the suspected module you should delete the whole module.

An active override is under the \override directory. So \override\classes\order\orderinvoice.php.

The file that you point to is just a file from the module package that can be installed as such.

 

 

Link to comment
Share on other sites

10 hours ago, musicmaster said:

You give a strange interpretation of my words. If ba_prestashop_invoice is the suspected module you should delete the whole module.

 An active override is under the \override directory. So \override\classes\order\orderinvoice.php.

 The file that you point to is just a file from the module package that can be installed as such.

  

 

Excuse me I don't really understand the dymanics of modules, templates and overrides in prestashop.

And i don't how i should deinstall this module: ba_prestashop_invoice. Because in the list of modules there is no such module..

Edited by MrTouch
added quote (see edit history)
Link to comment
Share on other sites

  • 1 month later...

Now that I am done with my finals for this semester I have time for this issue again...

I deinstalled and removed the modules I installed before getting this issue. I checked the Overrirdes. And found some stuff in there even after deinstalling the module: 

/*
* module: ba_prestashop_invoice
* date: 2019-02-10 02:06:30
* version: 1.1.31
*/
public function getDeliveryNumberFormatted($id_lang, $id_shop = null)
....
}

 

I uncommented this code, but still i get the same error like above. I dont really know what the next steps should be. 

 

I tried reinstalling this module "ba_prestashop_invoice" but still the same error.

Link to comment
Share on other sites

Modules are installed in a subdirectory of the modules directory and under the override directory. Normally uninstalling and deleting in the backoffice should delete both. When some override stays behind - as seems to happen in your case - you should delete it manually. Similarly, when the backoffice deletion works ok the subdirectory under /modules should have disappeared. If not, you should delete it manually.

getDeliveryNumberFormatted() is not a Prestashop function - a simple text search can teach you that. So it is a function of your module. So if it keeps getting called it means that some remainder of the module is still present in your system. You might do a simple text search to find out where.

  • Thanks 1
Link to comment
Share on other sites

Okay, I looked for this function and found it still in usage in themes\default\template\controllers\orders\_documents.tpl

{if get_class($document) eq 'OrderInvoice'}
	{if isset($document->is_delivery)}
		{$document->getDeliveryNumberFormatted($current_id_lang, $order->id_shop)}
	{else}
		{$document->getInvoiceNumberFormatted($current_id_lang, $order->id_shop)}
	{/if}
{elseif get_class($document) eq 'OrderSlip'}
	{$document->getCreditSlipsNumberFormatted($current_id_lang, $order->id_shop)}
{/if}

I did comment out those lines. And the error is gonne. But the page still doesn't load correctly. I dont see any more errors (except for a depricated mycript function, which i solved like stated in this post: 

Edit: I also added full text search results.

sdfa.JPG

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

  • 1 year later...
  • 1 year later...

Dear all, I am facing a similar problem where suddenly I receive a error 500 when trying to open my webpage or backend.  My page is www.opersis.gr. After talking to my server supplier they told me that there is a problem is caused from the (see attached files): 


They restored my page to a previous date and it worked for a couple of weeks but today my page died again. 
Unfortunately I do not have any dev experience.

 

Does anyone know where I can start from and how I can find which module might be that causes the above problem?

 

Thanks a lot in advance

opersis.PNG

Link to comment
Share on other sites

Strange error

Class ProductCore not found means that the file /classes/Product.php is missing.

The logs you show say that Malware was found on your system and for that reason files were moved. That seems to be the cause (line 11 says that that file was quarantined).

Freely translated: your site has been hacked or you have a virus and your hosting provider has some software that puts infected files into a safe location.

You will find some advice on the forum on how to deal with an infected site.

I have no idea what all that file decoding is doing.

Link to comment
Share on other sites

3 minutes ago, cs071372 said:

Thanks for the reply.

Do you know how I can restore the page on a previous date that was working? Yesterday for example that was working ok. Can I do it from the plesk panel?

I don't know how your Plesk panel is organized. You should search for a backup page.

Of course you can upload this specific file also from a fresh Prestashop installation of the same version - provided you didn't change it.

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...