Make WordPress Core

Opened 7 years ago

Closed 14 months ago

Last modified 14 months ago

#45694 closed defect (bug) (invalid)

Undefined Index: caption_id

Reported by: soben's profile Soben Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: Priority: normal
Severity: normal Version: 5.0.1
Component: Media Keywords: has-patch reporter-feedback
Focuses: Cc:

Description

Discovered this randomly on a local project.

Notice: Undefined index: caption_id in /var/www/html/wp-includes/media.php on line 1572

Discovered with PHP 7.2.10 and WordPress 5.0.1

It's just a warning but one nonetheless.

Attached will be the patch.

Attachments (1)

45694.patch (522 bytes) - added by Soben 7 years ago.

Download all attachments as: .zip

Change History (7)

@Soben
7 years ago

#1 @swissspidy
7 years ago

  • Component changed from General to Media

#2 @SergeyBiryukov
7 years ago

  • Milestone changed from Awaiting Review to 5.1
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#3 @pento
6 years ago

  • Keywords reporter-feedback added
  • Milestone changed from 5.1 to Future Release

@Soben: Do you have more information about how to reproduce this? $atts['caption_id'] should at least be set to an empty string by shortcode_atts().

#4 @hellofromTonya
14 months ago

  • Milestone Future Release deleted
  • Resolution set to invalid
  • Status changed from reviewing to closed

I'm not understanding how a PHP Notice is generated for a missing 'caption_id' key within the $atts. By default, that key gets set with a default value through shortcode_atts(). If the key exists in the incoming $attr, then the incoming value is retained. But in both cases, the key is set.

I'm also not able to reproduce the issue. Without more information such as step-by-step instructions, currently the ticket is not actionable.

Given it's been 5 years with no follow-up, I'll assume the issue was resolved. Closing the ticket.

Hello @Soben,

Does this issue still happen for you today?

  • If no, woohoo!
  • If yes, please reopen this ticket and provide instructions on how to reproduce. This helps contributors diagnose. Thanks.

#5 follow-up: @Soben
14 months ago

@hellofromTonya

If it's an example as to if this ticket is still an issue: I have forgotten about this, and I don't know how I missed the other responses (which annoys me)

I have not encountered this issue in a while, so I do agree with your assessment that maybe it has been resolved.

#6 in reply to: ↑ 5 @hellofromTonya
14 months ago

Replying to Soben:

I have not encountered this issue in a while, so I do agree with your assessment that maybe it has been resolved.

Thank you @Soben for confirming it's resolved. Appreciate you circling back :)

Note: See TracTickets for help on using tickets.