[wp-trac] Re: [WordPress Trac] #4538: Invalid Argument in
wp_add_post_tags loop
WordPress Trac
wp-trac at lists.automattic.com
Thu Jan 3 08:48:18 GMT 2008
#4538: Invalid Argument in wp_add_post_tags loop
-------------------------------------------------+--------------------------
Reporter: jcwinnie | Owner: anonymous
Type: defect | Status: reopened
Priority: normal | Milestone:
Component: Administration | Version: 2.3.2
Severity: normal | Resolution:
Keywords: foreach get_option utwimp tag2post |
-------------------------------------------------+--------------------------
Changes (by crenner):
* status: closed => reopened
* version: 2.3 => 2.3.2
* resolution: worksforme =>
Comment:
This error is still achievable with large amounts of post and tag data. We
had it with about 16k post/tag relationships. The import wizard saves its
data between server calls by using the wp_options table. On our server,
the write command for that particular variable was failing, because it
exceeded our MySQL maximum packet size (default is 1MB). So, the easy
solution for those of you with this issue is to up your mysql
max_allowed_packet (see http://dev.mysql.com/doc/refman/5.0/en/packet-too-
large.html ).
The long term solution to this is probably to not use the wp_options table
to store potentially large values. And honestly, it's not like this wizard
requires any step-by-step interaction with the user, it could be combined
into a single script and remove the need for storing values there anyways.
The solution suggested by pgdx (forcing $posts to be cast as an array)
doesn't actually help anything, it just removes the error. If $posts is
empty or null (as is the case when the option wasn't saved) this will just
end up with an array that contains a single null value. No importing would
actually happen in this case.
--
Ticket URL: <http://trac.wordpress.org/ticket/4538#comment:6>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list