Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#11507 closed defect (bug) (fixed)

Usefull errormessage is being surpressed on cron include

Reported by: hakre's profile hakre Owned by: sivel's profile sivel
Milestone: 3.0 Priority: normal
Severity: normal Version: 2.9
Component: General Keywords: has-patch
Focuses: Cc:

Description

@include_once(ABSPATH . 'wp-cron.php'); can be found in line 222 of /wp-includes/cron.php.

Using ABSPATH and having wp-cron.php in there should be ever the case otherwise it would be good to get a warning here.

Attachments (1)

11507.diff (400 bytes) - added by sivel 14 years ago.
Don't suppress when WP_DEBUG is enabled

Download all attachments as: .zip

Change History (11)

#1 follow-up: @westi
14 years ago

  • Milestone changed from 2.9.1 to 3.0

I don't think this is a severe enough issue for the 2.9.1 milestone.

This code is probably partly this way so that it can easily be shared with BackPress where the file might not always be there.

It is probably better to check for the file before including rather than using @ that way we could give some feedback on the fact that cron isn't going to work.

#2 in reply to: ↑ 1 @hakre
14 years ago

  • Milestone changed from 3.0 to 2.9.1

Replying to westi:

I don't think this is a severe enough issue for the 2.9.1 milestone.

Same problem here: I do not need this in 2.9.1 but there is no 2.9.2 milestone there fore I prefer 2.9.1 over 3.0 because it's fitting better.

This code is probably partly this way so that it can easily be shared with BackPress where the file might not always be there.

I'm talking about WordPress. When other projects share code they need to take care on their own. Especially on probabilities.

It is probably better to check for the file before including rather than using @ that way we could give some feedback on the fact that cron isn't going to work.

That's soo much reinventing the wheel as it has been proven plainly wrong in other projects. Include_Once does check for file existance. It does even provide a message if something goes wrong. The fix is to just remove the @. That simple it is.

#3 @westi
14 years ago

  • Keywords needs-patch added
  • Milestone changed from 2.9.1 to 3.0

Without the @ we will get a warning if the file is not there so if we want to remove the @ we must check for file existence.

Moving back to the 3.0 milestone for the same reasons as before - especially as this does not block you using the software in any way.

#4 @hakre
14 years ago

I want to have a pre 3.0 milestone so we can put the fixes in that did not went into 2.8 w/o the new features sheduled for 3.0. That's why.

#5 @dd32
14 years ago

I want to have a pre 3.0 milestone so we can put the fixes in that did not went into 2.8 w/o the new features sheduled for 3.0. That's why.

Thats what the 2.9.1 milestone is for, Bugs that are deserving of being fixed in a maintainence release. As westi has said, This is not and can wait until the next release.

#6 @hakre
14 years ago

+1 for just removing the @ operator here (to actually get a warning in case the file is not there) and while -1 for checking the file existance via file_exists because I trust that include will do it's job properly. Otherwise the @ operator should stay there an drop down the performance on each request for cron.

#7 @dd32
14 years ago

Doesnt using @ on an include also silence any warnings within that file?

#8 @sivel
14 years ago

  • Owner set to sivel
  • Status changed from new to accepted

@sivel
14 years ago

Don't suppress when WP_DEBUG is enabled

#9 @sivel
14 years ago

  • Keywords has-patch added; needs-patch removed

Following up on #13185 and r14345 don't suppress the include when WP_DEBUG is enabled.

#10 @ryan
14 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed
Note: See TracTickets for help on using tickets.