#45694 closed defect (bug) (invalid)
Undefined Index: caption_id
Reported by: |
|
Owned by: |
|
---|---|---|---|
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)
Change History (7)
#2
@
7 years ago
- Milestone changed from Awaiting Review to 5.1
- Owner set to SergeyBiryukov
- Status changed from new to reviewing
#4
@
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:
↓ 6
@
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.
@Soben: Do you have more information about how to reproduce this?
$atts['caption_id']
should at least be set to an empty string byshortcode_atts()
.