Ticket #2498 (closed defect (bug): fixed)

Opened 6 years ago

Last modified 5 years ago

faulty "referredby" in write post page

Reported by: sjoe Owned by: anonymous
Priority: normal Milestone:
Component: Administration Version: 2.0.1
Severity: normal Keywords: bg|has-patch bg|dev-feedback
Cc:

Description

hi guys,

i use as permalink structure "/%postname%/". in this case the reciving of the referer on the writing page (wp-admin/post.php) failed (only if you edit a existing post and is must be a draft). in consequence you will redircted to an not existing page.

Attachments

2498.diff Download (411 bytes) - added by technosailor 6 years ago.
tests for the existence of $posts[0]->ID

Change History

I have also experienced this.

Sometimes it's hard to see this problem as it causes an error message to appear inside a hidden form field.

Perhaps wpdb::print_error needs to be fixed so that this is more obvious (and also logs on PHP error log and doesn't continue processing the page)

Mark

tests for the existence of $posts[0]->ID

It happens because $post_id_array() does not exist. The $posts array only has a post_date member in this context and therefore fails the resulting SQL. Patch tests for the existence of at least one post ID as well before continuing execution.

comment:3   ryan6 years ago

Why would it have only a post_date member? get_posts() is checking the ID before it calls update_post_caches(). If this is broken, we probably need to fix it in get_posts().

You very well could be right, Ryan, but I spent the better part of two hours trying to track this bug because it is affecting a dozen of our blogs, and this was the best I could come up with.

Huh? Is anyone else really confused? Abrazell hasn't had anything to do with this bug, so I have no idea what you mean when you say "this" is the best you could come up with.

And we're not going to commit tickets that don't fully solve the problem. If your patch works for you, by all means use it. We'll have a better patch within a few days.

  • Keywords bg|has-patch bg|dev-feedback added

comment:8   ryan6 years ago

 This explains it. I think we just need an if empty check on this->posts right after we get_results. I'll put commit a hopeful fix to the 2.0 branch for everyone to test.

comment:9   ryan6 years ago

[3602] for 2.0 branch.

[3600] and [3601] for trunk.

Does that help?

  • Milestone set to 2.0.2

Confirmed on the forums.

  • Status changed from new to closed
  • Resolution set to fixed

"Huh? Is anyone else really confused? Abrazell hasn't had anything to do with this bug, so I have no idea what you mean when you say "this" is the best you could come up with."

I'm sorry if you think I have nothing to do with this bug. Perhaps you meant that I didn't submit it? Or maybe something else? I don't sit on Trac waiting for tickets precisely for this reason - when I've submitted patches, I get snide comments like this.

As it happens, I DO have something to do with this because it affects my 90 blogs that I am responsible to maintain. If the funnel effect spoken about in the hackers mailing list is in play, then let it vet the diff out. This is no way to get contributions.

And now I'm lurking on the Trac mailing list so I'll be happy to respond to further comments when they become available in this ticket.

Correction. I see the confusion. abrazell and technosailor are the same person: me.

Heh. I did have my suspicions. Thanks for clearing that up; there was nothning snide about my comments whatsoever and I'd hate random passers-by to think that there was.

Okay, confusion over :)

No problem. :)

  • Milestone 2.0.2 deleted

Milestone 2.0.2 deleted

Note: See TracTickets for help on using tickets.