If this is your first visit, check our documentation. To post, register or login.
Forums / Bug Reports / [Fixed v1.5.1]Specials problem with debug warning: PHP Warning: json_encode() ......

[Fixed v1.5.1]Specials problem with debug warning: PHP Warning: json_encode() ......

Started by thannaree on 18 Jul 2012, 7:38 AM · Views: 2,605

Results 1 to 9 of 9
18 Jul 2012, 7:38 AM
#1
thannaree avatar

thannaree

Zen Follower

Join Date:
Dec 2010
Location:
Thailand
Posts:
304
Plugin Contributions:
1

[Fixed v1.5.1]Specials problem with debug warning: PHP Warning: json_encode() ......

Hi,

I use ZC version 1.5.

Today I experienced some problem with the Catalog>Specials. I select a product, enter a date and a 5% discount and insert. The item is now on specials but with a 20% discount. I tried again, but whatever % discount I enter, the item is displayed on specials with 20% discount.

I checked the cache/debug and found the following:

[17-Jul-2012 04:55:26] PHP Warning:  json_encode() [<a href='function.json-encode'>function.json-encode</a>]: Invalid UTF-8 sequence in argument in / MYADMIN /includes/init_includes/init_admin_history.php on line 34

I checked with the hosting and they tell me that they did not made any changes to the server in the past weeks. They also mention the following:

When looking at /MYADMIN/includes/init_includes/init_admin_history.php I do not see a closing ?> tag anywhere and the script just abruptly ends (which would certainly cause issues). These are the last 5 lines of that file (notice no PHP closing tag):
root@gemini [~]# tail -n 5 /home/ezistock/public_html/A123soleil/includes/init_includes/init_admin_history.php
return htmlspecialchars(WARNING_REVIEW_ROGUE_ACTIVITY . "\n" . implode(' and ', $matches[1]));
} else {
return FALSE;
}
}

Meanwhile, I try again and now everything seems suddenly back to normal. Do you know what could have caused the issue, and if there's anything I can do to prevent it from happening again?

18 Jul 2012, 8:05 AM
#2
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: [Fixed v1.5.1]Specials problem with debug warning: PHP Warning: json_encode() ......

Thannaree:

I checked with the hosting and they tell me that they did not made any changes to the server in the past weeks.

The support crew used by many hosts lie :( (or at the very least try to 'bluff' their way out of accepting responsibility for any problems)

Thannaree:

They also mention the following:
"When looking at /MYADMIN/includes/init_includes/init_admin_history.php I do not see a closing ?> tag anywhere and the script just abruptly ends (which would certainly cause issues). "

The lack of a closing tag is fine/normal and will not 'cause issues'.
http://www.zen-cart.com/content.php?271-some-of-my-php-files-are-missing-the-at-the-end-of-the-file

Thannaree:

Meanwhile, I try again and now everything seems suddenly back to normal. Do you know what could have caused the issue, and if there's anything I can do to prevent it from happening again?

Computer problems generally don't fix themselves. Nor do they tend to break by themselves (hardware failures excepted), so if you haven't changed anything to either cause or cure the problem then your host has. They are simply not acknowledging the fact.

Cheers
Rod

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

18 Jul 2012, 8:15 AM
#3
thannaree avatar

thannaree

Zen Follower

Join Date:
Dec 2010
Location:
Thailand
Posts:
304
Plugin Contributions:
1

Re: [Fixed v1.5.1]Specials problem with debug warning: PHP Warning: json_encode() ......

RodG:

The support crew used by many hosts lie :( (or at the very least try to 'bluff' their way out of accepting responsibility for any problems)

The lack of a closing tag is fine/normal and will not 'cause issues'.
http://www.zen-cart.com/content.php?271-some-of-my-php-files-are-missing-the-at-the-end-of-the-file

Computer problems generally don't fix themselves. Nor do they tend to break by themselves (hardware failures excepted), so if you haven't changed anything to either cause or cure the problem then your host has. They are simply not acknowledging the fact.

Cheers
Rod

Thanks Rod for your prompt reply! I also tend to think likewise ... though for a moment I was also concerned with hacking.

18 Jul 2012, 8:36 AM
#4
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: [Fixed v1.5.1]Specials problem with debug warning: PHP Warning: json_encode() ......

When looking at /MYADMIN/includes/init_includes/init_admin_history.php I do not see a closing ?> tag anywhere and the script just abruptly ends (which would certainly cause issues).

What rubbish!

This guy obviously knows nothing about php, as the closing tag is no longer used (or needed) in a php file.

And as it indicates his general level of competence (which is sadly lacking), I would be very concerned about hosting with them. My reply to him would be.

"As you demonstrate a worrying lack of understanding about how php files are coded these days, my feeling is that such ignorance is something that would certainly cause issues. Please can I have a full refund on my hosting as I intend to move somewhere where the support staff do have required expertise."

20 years a Zencart User

18 Jul 2012, 9:27 AM
#5
thannaree avatar

thannaree

Zen Follower

Join Date:
Dec 2010
Location:
Thailand
Posts:
304
Plugin Contributions:
1

Re: [Fixed v1.5.1]Specials problem with debug warning: PHP Warning: json_encode() ......

schoolboy:

What rubbish!

This guy obviously knows nothing about php, as the closing tag is no longer used (or needed) in a php file.

And as it indicates his general level of competence (which is sadly lacking), I would be very concerned about hosting with them. My reply to him would be.

This concerns me as I have been pleased by the level of service this host has given to us so far -the one we previously used was a big name, and also a catastrophe- phoo!

Could you guys possibly recommend a good hosting service by PM?

18 Jul 2012, 3:18 PM
#6
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: [Fixed v1.5.1]Specials problem with debug warning: PHP Warning: json_encode() ......

Thannaree:

This concerns me as I have been pleased by the level of service this host has given to us so far -the one we previously used was a big name, and also a catastrophe- phoo!

Could you guys possibly recommend a good hosting service by PM?

If you've been happy with the service I'd not be recommending your switch to another host on the basis of this one experience. As is often quoted, 'better the devil you know'.

Besides, the reply you got from the host isn't 'unusual' and it is hard to judge the reliabilty of a service based on the response of one droid that may be having his/her first day on the job, or simply a bad day.

One on my 'favourite' hosts is absolutely full of ignorant bs whenever I see or report a problem. Clearly the persons I origianlly deal with have dubious skills, but the company they work for provides one of the most reliable servers I've ever used, and at a good price too. As frustrating as it is, I tolerate their billshot because sooner or later my reports do get escalated up to someone that does know what they are doing and things get solved. It is often a bit like pulling teeth, but in the end I'm quite satisfied, all things considered.

just something to keep in mind.

Cheers
Rod

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

18 Jul 2012, 3:43 PM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: [Fixed v1.5.1]Specials problem with debug warning: PHP Warning: json_encode() ......

Thannaree:

Invalid UTF-8 sequence in argument
The error message suggests that some character that was input was seen as invalid. Did you copy+paste from someplace else when entering the content into that page? Especially from some microsoft application?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

20 Jul 2012, 4:06 AM
#8
thannaree avatar

thannaree

Zen Follower

Join Date:
Dec 2010
Location:
Thailand
Posts:
304
Plugin Contributions:
1

Re: [Fixed v1.5.1]Specials problem with debug warning: PHP Warning: json_encode() ......

If you've been happy with the service I'd not be recommending your switch to another host on the basis of this one experience. As is often quoted, 'better the devil you know'.

Besides, the reply you got from the host isn't 'unusual' and it is hard to judge the reliabilty of a service based on the response of one droid that may be having his/her first day on the job, or simply a bad day.

One on my 'favourite' hosts is absolutely full of ignorant bs whenever I see or report a problem. Clearly the persons I origianlly deal with have dubious skills, but the company they work for provides one of the most reliable servers I've ever used, and at a good price too. As frustrating as it is, I tolerate their billshot because sooner or later my reports do get escalated up to someone that does know what they are doing and things get solved. It is often a bit like pulling teeth, but in the end I'm quite satisfied, all things considered.

just something to keep in mind.

Cheers
Rod

Yes Rod, I do not actually plan to move to another host at this stage. But it would be good to know of another good hosting just in case.

The error message suggests that some character that was input was seen as invalid. Did you copy+paste from someplace else when entering the content into that page? Especially from some microsoft application?

I did not copy+paste, I just typed 10% directly from the keyboard in the Special Price field.

19 Sep 2012, 2:37 AM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: [Fixed v1.5.1]Specials problem with debug warning: PHP Warning: json_encode() ......

v1.5.1 contains updates that should resolve this issue.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.