- Posts: 3
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- Warning: explode() expects parameter 2 to be string...
Warning: explode() expects parameter 2 to be string...
- Mark Canham
-
Topic Author
- Offline
- New Member
Less
More
14 years 11 months ago #83455
by Mark Canham
Warning: explode() expects parameter 2 to be string... was created by Mark Canham
Hi, This is my first post, so first things first, Hello.
I'm not sure if this is a bug or not, but I was not sure where else to put it. With php error display on I am getting the following errors when viewing an item, or a category list.
Warning: explode() expects parameter 2 to be string, array given in /home/mark/WebSites/pech/components/com_k2/helpers/route.php on line 73 Warning: Invalid argument supplied for foreach() in /home/mark/WebSites/pech/components/com_k2/helpers/route.php on line 74
And when logged in and clicking on My Page, i get a 404 and the same error message.
lines 73 and 74 of route.php are:
73. $items = explode(',', $params->get('SEFReplacements'));
74. foreach ($items as $item) {
I added in print_r($params->get('SEFReplacements')); to have a look at what the array was to try and get an idea of what the problem was. The data in the array doesn't seems to be strings, for example: [0] => Š[1] => S, Œ [2] => O, Ž .
I'm running this development environment on a LAMP server installed on Ubuntu 10.04 desktop.
I've had a search here and on google and cannot find any other instances of this, so I am thinking it must be a problem with my server config or something. I've attached and html file of my phpinfo() so hopefully someone will be able to point me in the right direction.
Thanks in advance...
I'm not sure if this is a bug or not, but I was not sure where else to put it. With php error display on I am getting the following errors when viewing an item, or a category list.
Warning: explode() expects parameter 2 to be string, array given in /home/mark/WebSites/pech/components/com_k2/helpers/route.php on line 73 Warning: Invalid argument supplied for foreach() in /home/mark/WebSites/pech/components/com_k2/helpers/route.php on line 74
And when logged in and clicking on My Page, i get a 404 and the same error message.
lines 73 and 74 of route.php are:
73. $items = explode(',', $params->get('SEFReplacements'));
74. foreach ($items as $item) {
I added in print_r($params->get('SEFReplacements')); to have a look at what the array was to try and get an idea of what the problem was. The data in the array doesn't seems to be strings, for example: [0] => Š[1] => S, Œ [2] => O, Ž .
I'm running this development environment on a LAMP server installed on Ubuntu 10.04 desktop.
I've had a search here and on google and cannot find any other instances of this, so I am thinking it must be a problem with my server config or something. I've attached and html file of my phpinfo() so hopefully someone will be able to point me in the right direction.
Thanks in advance...
Please Log in or Create an account to join the conversation.
- Mark Canham
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 3
14 years 11 months ago #83456
by Mark Canham
Replied by Mark Canham on topic Warning: explode() expects parameter 2 to be string...
I've created a new instance of Joomla + K2 and set it pretty much identically to the original, checking all they way to see what may have caused the issue. Of course the new instance is working fine! So I've no idea what caused the issue :(, some kind to database corruption?
As I'm only really at the start of this project its not going to be a problem to ditch the old instance and move on.
As I'm only really at the start of this project its not going to be a problem to ditch the old instance and move on.
Please Log in or Create an account to join the conversation.
- Trung Chu Huu
-
- Offline
- New Member
Less
More
- Posts: 1
14 years 8 months ago #83457
by Trung Chu Huu
Replied by Trung Chu Huu on topic Warning: explode() expects parameter 2 to be string...
Hi mate,
Very simple: login to back-end of your site, go to K2 component, click to Parameters button ( on right side) and click Save button.
Check your site again. wow Notice disappeared :))
Very simple: login to back-end of your site, go to K2 component, click to Parameters button ( on right side) and click Save button.
Check your site again. wow Notice disappeared :))
Please Log in or Create an account to join the conversation.
- Dylan James
-
- Offline
- New Member
Less
More
- Posts: 3
14 years 8 months ago #83458
by Dylan James
Replied by Dylan James on topic Warning: explode() expects parameter 2 to be string...
Great, that really was a simple fix! Thanks.
Trung Chu Huu said:Hi mate,
Very simple: login to back-end of your site, go to K2 component, click to Parameters button ( on right side) and click Save button.
Check your site again. wow Notice disappeared :))
Trung Chu Huu said:Hi mate,
Very simple: login to back-end of your site, go to K2 component, click to Parameters button ( on right side) and click Save button.
Check your site again. wow Notice disappeared :))
Please Log in or Create an account to join the conversation.
- Lester Arévalo
-
- Offline
- New Member
Less
More
- Posts: 3
14 years 8 months ago #83459
by Lester Arévalo
Replied by Lester Arévalo on topic Warning: explode() expects parameter 2 to be string...
thank you very much, that was excellent
Trung Chu Huu said:Hi mate,
Very simple: login to back-end of your site, go to K2 component, click to Parameters button ( on right side) and click Save button.
Check your site again. wow Notice disappeared :))
Trung Chu Huu said:Hi mate,
Very simple: login to back-end of your site, go to K2 component, click to Parameters button ( on right side) and click Save button.
Check your site again. wow Notice disappeared :))
Please Log in or Create an account to join the conversation.
- himple
-
- Offline
- New Member
Less
More
- Posts: 1
14 years 8 months ago #83460
by himple
Replied by himple on topic Warning: explode() expects parameter 2 to be string...
great great great !
How did you manage to do that ?
How did you manage to do that ?
Please Log in or Create an account to join the conversation.
- Peter
-
- Offline
- New Member
- Imagination is your only limitation
14 years 3 months ago #83461
by Peter
Imagination is your only limitation
Replied by Peter on topic Warning: explode() expects parameter 2 to be string...
Just fixed the same error that appeared on our server after we had upgraded our PHP version from 5.2.x to 5.3.4
Resaving the parameters fixed the issue.
Resaving the parameters fixed the issue.
Imagination is your only limitation
Please Log in or Create an account to join the conversation.
- Forum
- K2 Community Forum
- English K2 Community
- Warning: explode() expects parameter 2 to be string...