Closed GoogleCodeExporter closed 9 years ago
Ok, I've reproduced this -- it's helpful if you paste in your URL. To
reproduce:
1. Show all posts (pages, etc).
2. Filter by category (e.g. show all uncategorized)
3. Attempt to apply a new category (e.g. you can re-select "uncategorized") and
attempt to save.
It seems that when you attempt to submit your changes, the post_type parameter
in the URL gets malformed -- it shows up as "Array", e.g.:
http://mysite.com/wp-admin/edit.php?s=&post_status=all&post_type=Array&_wpnonce=
b4410495bf&_wp_http_referer=%2Fwp-admin%2Fedit.php%3Fs%26post_status%3Dall%26pos
t_type%3Dmovie%26action%3D-1%26m%3D0%26cat%3D24%26paged%3D1%26mode%3Dlist%26acti
on2%3D-1&action=edit&m=0&cat=24&paged=1&mode=list&post_category%5B%5D=0&post_cat
egory%5B%5D=17&tax_input%5Bpost_tag%5D=&_status=-1&bulk_edit=Update&post_view=li
st&screen=edit-movie&post%5B%5D=75&post%5B%5D=78&post%5B%5D=77&action2=-1
When the CCTM is deactivated, performing the same steps preserves the post_type
parameter, e.g.
http://mysite.com/wp-admin/edit.php?s&post_status=all&post_type=post&m=0&cat=1&p
aged=1&mode=list&updated=5&skipped=0&locked=0
I don't know where all those other URL parameters are coming from, but the
post_type is definitely wrong.
My best guess of where this is being caused is in the problematic and
frequently broken request filter that has been the cause of many glitches like
this. My guess is that it's returning an array of post-types instead of a
single value...
Original comment by ever...@fireproofsocks.com
on 17 Feb 2013 at 4:55
Thanks for the response and for looking into it. It's one of those 'bugs' that
once you know it's there, a work-around is easy ... simply deactivate CCTM, do
what you gonna do ... and reactivate the plugin.
As you've already said, no 'damage' is done to any fields created by CCTM when
you make any necessary changes, so it's a bit of a pain rather than a 'show
stopper'.
For reference - a bit late now, sorry, - typical URL is
http://captioned.s-t-u-f-f.net, though obviously in this case no effects of the
issue are visible.
Original comment by michael...@gmail.com
on 17 Feb 2013 at 5:07
Deactivating is a poor workaround... and not one that works when you need to
bulk edit custom post-types.
Original comment by ever...@fireproofsocks.com
on 17 Feb 2013 at 5:10
Lol, oh yeah! Hadn't thought of that ... probably because I don't use them
myself at the moment.
Original comment by michael...@gmail.com
on 17 Feb 2013 at 5:17
Yep, it's that same cursed filter. The fix is this: inside of
includes/CCTM.php inside the request_filter() function, add this at the top
(say at line 2149):
if ( substr($_SERVER['SCRIPT_NAME'], strrpos($_SERVER['SCRIPT_NAME'], '/')+1) == 'edit.php'
&& self::get_value($_GET, 'post_type')) {
return $query;
}
That will prevent the filter from being applied on the edit page. I'm
seriously concerned though that this (like all the other fixes regarding this
filter) will have unintended consequences. The WP architecture is just not
good for this type of thing.
Original comment by ever...@fireproofsocks.com
on 17 Feb 2013 at 5:24
Thanks for the fix. I tried to install as instructed but guess I did it wrongly
as it didn't seem to work. Was going to say that I'll wait for if / when you
include the fix in a plugin upgrade, but as I've just downloaded your latest,
and the bug seems to have gone away, I guess you've already done it! Many many
thanks.
Original comment by michael...@gmail.com
on 19 Feb 2013 at 4:11
The plugin upgrade was released yesterday -- 0.9.7 is available and your sites
should receive notices that an update is available (WordPress repo has been
very unreliable with updates recently for some reason). I was able to verify
the behavior, and the fix outlined above fixed it. So confirm your version
number -- if you are using the latest version and still experiencing the
problem, then post back here with details.
Original comment by ever...@fireproofsocks.com
on 19 Feb 2013 at 4:55
Original issue reported on code.google.com by
michael...@gmail.com
on 17 Feb 2013 at 11:05Attachments: