.weblog engine
FAQ :: Search ::  Memberlist ::  Register :: Profile ::  Usergroups ::  Log in
Log in to check your private messages ::  Download Pivot :: Support Pivot | Info
Help others in the Pivot Community by posting answers to questions whenever you can!
Notice: Array to string conversion

 
Post new topic   Reply to topic   printer-friendly view    Pivot Support Forum Index -> 1.40.7 Bugs
View previous topic :: View next topic  
Author Message
l2g3
Pivot Groupie In Training
Pivot Groupie In Training


Joined: 29 May 2007
Posts: 3

PostPosted: Tue May 29, 2007 5:22 pm    Post subject: Notice: Array to string conversion Reply with quote

Pivot version: 1.40.1
Install: clean
OS: WindowsXP Pro SP2, Firefox 2.0.0.3
Devel platform on the same computer: XAMPP 1.6.1
PHP status: safe_mode = Off, register_globals = Off, error_reporting = E_ALL

Description: while logged in as Administrator, go to menu "New Entry", enter any new entry data (only title and introduction with some text) for testing, then press button "Preview Entry", new window opens for entry preview - on top of this page content notice text is produced:

Code:
Notice: Array to string conversion in C:\xampp\htdocs\pivot-test-site\pivot\first_defense.php on line 120


Solution: array $postedData on line 120 (in file C:\xampp\htdocs\pivot-test-site\pivot\first_defense.php) has to be imploded recursively, because any element of arrays $_GET and $_POST can be an array. In my case it seemed to be true. So replaced that code line with this code:

Code:
//This function will implode a multi-dimension array
//Function code taken from php manual description of function implode(), commenter gregrahkin
function implode_r($glue, $pieces){
   $out = "";
   foreach($pieces as $piece)
      if(is_array($piece)) $out .= implode_r($glue, $piece); // recurse
      else $out .= $glue . $piece;
   return $out;
}
$postedData = strtolower(implode_r(" ", $postedData));
Back to top
View user's profile Send private message
hansfn
Pivot Team
<b>Pivot Team</b><!-- Developer -->


Joined: 15 May 2004
Posts: 5267
Location: Molde, Norway

PostPosted: Tue May 29, 2007 5:41 pm    Post subject: Re: Notice: Array to string conversion Reply with quote

Just lower your error reporting level. You are using "E_ALL", which is fine if you are developing PHP software and need the extra info, else use "E_ALL ^ E_NOTICE". There are plenty of other notices - "No index xyz ..." and so on.

It's a notice, not an error, not even a warning ... PHP did do the right thing - no harm in using the current code as it is.

_________________
My Pivot bookmarks, snippets and scripts| Pivot Documentation Project: Template tags
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
l2g3
Pivot Groupie In Training
Pivot Groupie In Training


Joined: 29 May 2007
Posts: 3

PostPosted: Wed May 30, 2007 8:20 am    Post subject: Re: Notice: Array to string conversion Reply with quote

Well, in that case my standards are a little bit higher Cool
I won't let any Notice exist. My rule: in the development environment no notices shoud be present.


hansfn wrote:
Just lower your error reporting level. You are using "E_ALL", which is fine if you are developing PHP software and need the extra info, else use "E_ALL ^ E_NOTICE". There are plenty of other notices - "No index xyz ..." and so on.

It's a notice, not an error, not even a warning ... PHP did do the right thing - no harm in using the current code as it is.
Back to top
View user's profile Send private message
hansfn
Pivot Team
<b>Pivot Team</b><!-- Developer -->


Joined: 15 May 2004
Posts: 5267
Location: Molde, Norway

PostPosted: Wed May 30, 2007 8:48 am    Post subject: Re: Notice: Array to string conversion Reply with quote

Then you have too much time Wink Anyway, thanks for the report.
_________________
My Pivot bookmarks, snippets and scripts| Pivot Documentation Project: Template tags
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
l2g3
Pivot Groupie In Training
Pivot Groupie In Training


Joined: 29 May 2007
Posts: 3

PostPosted: Wed May 30, 2007 9:50 am    Post subject: Re: Notice: Array to string conversion Reply with quote

Maybe, maybe not Smile
But nevertheless Pivot is great It's Gris !!!
Back to top
View user's profile Send private message
hansfn
Pivot Team
<b>Pivot Team</b><!-- Developer -->


Joined: 15 May 2004
Posts: 5267
Location: Molde, Norway

PostPosted: Fri Aug 03, 2007 4:57 am    Post subject: Re: Notice: Array to string conversion Reply with quote

OK, this is indeed a very annoying notice - so I killed it:
http://pivot-weblog.svn.sourceforge.net/pivot-weblog/?rev=657&view=rev
This will be part of the soon coming 1.40.4.

PS! Sorry for not fixing it immediately.

_________________
My Pivot bookmarks, snippets and scripts| Pivot Documentation Project: Template tags
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    Pivot Support Forum Index -> 1.40.7 Bugs All times are GMT - 4 Hours
Page 1 of 1
|
 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Your generosity is appreciated!
Joanna was the last to make a donation
:: go here for sponsorship information ::
Special thanks to our platinum sponsors: Joanna, Derk de Zee.  
DreamHost

powered by phpBB | RSS Feed