Jump to content

Bug on BackOffice "Number 1" At top of the page.


Drens

Recommended Posts

Hi, i have been looking into this bug recently and i cant patch it.

There is some pages on back office (Products, Modules and so on) that a numer "1" appears at the top of the site and i cant find why.

 

I open the developers console to inspect it and its just a number with spaces. 

I am worried about security issues or not sure, i havent published my website yet and also, i havent touched any file from admin folder.

 

This issue just appeared randomly.

 

Any help?
 

post-1428864-0-03183500-1508346596_thumb.png

post-1428864-0-17118900-1508346669_thumb.png

Link to comment
Share on other sites

There is some errant code and this is going to be very difficult to find.  But I suspect that someone has edited a module or template file and accidentally placed the number 1, which is then appearing in the output.  Unfortunately there is not an easy way to troubleshoot this, without stepping through the code and finding it

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

Hi everyone

i have the same error! i'm going crazy to find a way to remove that 1

i hope they can fix this in the next release.. i just updated now to 1.7.2.4 and the "1" is still there..

inspecting it with the browser doesn't give any information about..59ef836d03984_errorcatalog.thumb.png.1ab2a6a9079c8455565bfe2b7ba9e816.png

 

error catalog.png

Link to comment
Share on other sites

3 hours ago, capocopa said:

i have the same error! i'm going crazy to find a way to remove that 1

i hope they can fix this in the next release.. i just updated now to 1.7.2.4 and the "1" is still there..

This is not an issue with Prestashop, this is an issue with a module or customization you have made to your store. 

Link to comment
Share on other sites

  • 4 weeks later...

Hi

i tried to disable all overrides and all non native modules.. and the 1 is still there

of course i cleaned cache and changed browsers too

i didn't any change to prestashop apart from theme and modules

if anyone having the same issue has fixed it please let us know

best regards

Francesco Capodagli

Link to comment
Share on other sites

34 minutes ago, capocopa said:

Hi

i tried to disable all overrides and all non native modules.. and the 1 is still there

of course i cleaned cache and changed browsers too

i didn't any change to prestashop apart from theme and modules

if anyone having the same issue has fixed it please let us know

best regards

Francesco Capodagli

 

The number "1" is a default behavior of Smarty when using the modifier "|print_r". In this case, what we can suggest you is download your store files and search in all files for the words "|print_r" in all "*.tpl" files.

 

Best regards,
Web Development VIZO.

Link to comment
Share on other sites

I have the same problem on Prestashop 1.7.2.3. I have documented all changes I have made to Prestashop files and i'm sure I have not added number one anywhere. So this must have come with a module or theme. 
Like mentioned above, it only appears on Catalog and Modules sections (maybe a few other, I can't check at the moment because now it's not there).
On these pages the top left loading circle is also different for some reason.
Strange thing is that it comes and goes randomly, Sometimes it's there, sometimes it's not.

Does Prestashop still use Smarty if I have all options under CCC (COMBINE, COMPRESS AND CACHE) set to No? (Thats the only place I see Smarty mentioned)

  • Like 1
Link to comment
Share on other sites

Prestashop still uses smarty, regardless of your option to use CCC, they are unrelated items.

There is nothing we can do on the forums to help you with this, somewhere on your store a module or theme file has been updated to cause this issue.  You could try going through all the module positions in the back office and removing them one by one to see which module and which module hook is causing the issue.

Link to comment
Share on other sites

In my store the problem was with the Paypal Module!!!

On the modules/paypal.php on the function "hookDisplayBackOfficeHeader" I found this:

if (!$bt_orders) {
	return true;
}
Configuration::updateValue('PAYPAL_CRON_TIME', date('Y-m-d H:i:s'));
$method = AbstractMethodPaypal::load('BT');
$transactions = $method->searchTransactions($bt_orders);
foreach ($transactions as $transaction) {
	$paypal_order_id = PaypalOrder::getIdOrderByTransactionId($transaction->id);
	$paypal_order = PaypalOrder::loadByOrderId($paypal_order_id);
	$ps_order = new Order($paypal_order_id);
	switch ($transaction->status) {
		case 'declined':
			$paypal_order->payment_status = $transaction->status;
			$ps_order->setCurrentState(Configuration::get('PS_OS_ERROR'));
			break;
		case 'settled':
			$paypal_order->payment_status = $transaction->status;
			$ps_order->setCurrentState(Configuration::get('PS_OS_PAYMENT'));
			break;
		default:
			// do nothing and check later one more time
			break;
	}
	$paypal_order->update();
}

The correct code is:

if (!$bt_orders) {
	//return true;
}else{
	Configuration::updateValue('PAYPAL_CRON_TIME', date('Y-m-d H:i:s'));
	$method = AbstractMethodPaypal::load('BT');
	$transactions = $method->searchTransactions($bt_orders);
	foreach ($transactions as $transaction) {
		$paypal_order_id = PaypalOrder::getIdOrderByTransactionId($transaction->id);
		$paypal_order = PaypalOrder::loadByOrderId($paypal_order_id);
		$ps_order = new Order($paypal_order_id);
		switch ($transaction->status) {
			case 'declined':
				$paypal_order->payment_status = $transaction->status;
				$ps_order->setCurrentState(Configuration::get('PS_OS_ERROR'));
				break;
			case 'settled':
				$paypal_order->payment_status = $transaction->status;
				$ps_order->setCurrentState(Configuration::get('PS_OS_PAYMENT'));
				break;
			default:
				// do nothing and check later one more time
				break;
		}
		$paypal_order->update();
	}
}

 

Link to comment
Share on other sites

  • 3 weeks later...
On 30/11/2017 at 2:41 PM, MrPez said:

In my store the problem was with the Paypal Module!!!

On the modules/paypal.php on the function "hookDisplayBackOfficeHeader" I found this:


if (!$bt_orders) {
	return true;
}
Configuration::updateValue('PAYPAL_CRON_TIME', date('Y-m-d H:i:s'));
$method = AbstractMethodPaypal::load('BT');
$transactions = $method->searchTransactions($bt_orders);
foreach ($transactions as $transaction) {
	$paypal_order_id = PaypalOrder::getIdOrderByTransactionId($transaction->id);
	$paypal_order = PaypalOrder::loadByOrderId($paypal_order_id);
	$ps_order = new Order($paypal_order_id);
	switch ($transaction->status) {
		case 'declined':
			$paypal_order->payment_status = $transaction->status;
			$ps_order->setCurrentState(Configuration::get('PS_OS_ERROR'));
			break;
		case 'settled':
			$paypal_order->payment_status = $transaction->status;
			$ps_order->setCurrentState(Configuration::get('PS_OS_PAYMENT'));
			break;
		default:
			// do nothing and check later one more time
			break;
	}
	$paypal_order->update();
}

The correct code is:


if (!$bt_orders) {
	//return true;
}else{
	Configuration::updateValue('PAYPAL_CRON_TIME', date('Y-m-d H:i:s'));
	$method = AbstractMethodPaypal::load('BT');
	$transactions = $method->searchTransactions($bt_orders);
	foreach ($transactions as $transaction) {
		$paypal_order_id = PaypalOrder::getIdOrderByTransactionId($transaction->id);
		$paypal_order = PaypalOrder::loadByOrderId($paypal_order_id);
		$ps_order = new Order($paypal_order_id);
		switch ($transaction->status) {
			case 'declined':
				$paypal_order->payment_status = $transaction->status;
				$ps_order->setCurrentState(Configuration::get('PS_OS_ERROR'));
				break;
			case 'settled':
				$paypal_order->payment_status = $transaction->status;
				$ps_order->setCurrentState(Configuration::get('PS_OS_PAYMENT'));
				break;
			default:
				// do nothing and check later one more time
				break;
		}
		$paypal_order->update();
	}
}

 

it doesn't work! i get error 500 with your code

i hope that someone can find a solution.. i'm disabling all modules but i can't find which one cause this issue.. 

anyway it can't be a edit we did in our prestashop.. it's something that comes from a module because it's strange that different people do the same mistake in code editing

Link to comment
Share on other sites

Hi everyone!!

problem solved!! thanks to all of you guys!! the problem is infact paypal module!

but also disabling it the error of "1" did not get fixed in my case... that's why i couldn't find the problem..

so i tried to completely UNINSTAL paypal and remove it's folder from modules trough ftp and after that i reinstalled it and configured it again and now it seems finally fixed!

i noticed that after the last update with support for braintree the module configuration was buggy if you come from a precedent version.. so if you get the 1 let's try do this things!

Thank you so much again to everybody and let's have a nice Christmas! :D

Francesco Capodagli

 

 

Link to comment
Share on other sites

On 22/12/2017 at 9:47 PM, capocopa said:

Hi everyone!!

problem solved!! thanks to all of you guys!! the problem is infact paypal module!

but also disabling it the error of "1" did not get fixed in my case... that's why i couldn't find the problem..

so i tried to completely UNINSTAL paypal and remove it's folder from modules trough ftp and after that i reinstalled it and configured it again and now it seems finally fixed!

i noticed that after the last update with support for braintree the module configuration was buggy if you come from a precedent version.. so if you get the 1 let's try do this things!

Thank you so much again to everybody and let's have a nice Christmas! :D

Francesco Capodagli

 

 

Hello, I'm not even using PayPal here and after the update to PS 1.6.1.17 I have this issue on FRONT page...

What I need to inspect, please? and what's "braintree" ?

Link to comment
Share on other sites

Hi mmsh
if you have this error in front office i think that it's not related to this problem
the "1" in backoffice comes 100% sure from paypal+braintree module
so your 1 must come from somewhere else for sure.. try inspecting your front office code to see if you can find informations about from where it comes

 

 

Link to comment
Share on other sites

modules/paypal/paypal.php

It's worked, only thing is change the function public function hookDisplayBackOfficeHeader()

Remove " true " from the line, then it's work now

            if (!$bt_orders) {
                return true;
            }

to

            if (!$bt_orders) {
                return;
            }

  • Like 1
Link to comment
Share on other sites

Works Thx.!

On 29-12-2017 at 1:50 AM, guuds said:

modules/paypal/paypal.php

It's worked, only thing is change the function public function hookDisplayBackOfficeHeader()

Remove " true " from the line, then it's work now

            if (!$bt_orders) {
                return true;
            }

to

            if (!$bt_orders) {
                return;
            }

 

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