Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It seems that something is broken when generating media name for pinterest media entities. They all have only 'h' a media name. I have also
Comment | File | Size | Author |
---|---|---|---|
#15 | 2837977_media-name-always-h.patch | 1.03 KB | extect |
| |||
#14 | Warnings_MediaEntityPinterest.txt | 15.66 KB | extect |
#8 | media_name_always_h-2837977-8.patch | 1.1 KB | chr.fritsch |
| |||
#5 | media_entity_pinterest-media_name_always_h-2837977-5.patch | 620 bytes | IT-Cru |
|
Comments
Comment #2
gg4 CreditAttribution: gg4 commented@IT-Cru, can you provide some quick steps to reproduce so I can look into this?
Comment #3
IT-CruIt seems, that in getDefaultName all 3 variables have value 'h'. So I think here is a good starting point to debug. I think it's 'h' from http:// of pinterest URL.
Reproduce:
* Create a pinterest media entity
* Add link URL only field
* Configure URL field for media entity provider
* No API & skip metadata fields
Add following URL https://www.pinterest.com/pin/99360735500167749/ without a media name and safe media entity.
Comment #4
IT-CruIn Plugin/MediaEntity/Type/Pinterest.php $matches seems to be incorrect for getting media name after reset($matches) which works for pin URLs but not for other requirements. Index 'id' isn't found and so first element of string array 'h' of http is returned (see added hint from xdebug).
Comment #5
IT-CruComment #6
gg4 CreditAttribution: gg4 commented@IT-Cru Thanks for the patch. This looks reasonable, but was not able to reproduce the issue with the steps you provided, specifically the final step of saving the media entity without the _Media name_ field completed. Let me know if I am misunderstanding, but you should not be able to same the entity with this field as it is required.
Comment #7
gg4 CreditAttribution: gg4 commentedComment #8
chr.fritschI can confirm the bug. I could reproduce it with the steps IT-Cru described in #3.
I extended the patch a bit, with more safe field checks.
Comment #9
daniel.bosenThe patch in #8 works for me.
Comment #10
gg4 CreditAttribution: gg4 commented@chr.fritsch @daniel.bosen -- This patch seems sane, but I have still not been able to repro this issue. Would you mind providing more detailed steps you were taking to see this issue?
Comment #11
IT-Cru@chr.fritsch and @daniel.bosen: Perhaps this is only an issue with the "media name could be empty" patch from thunder distribution?
Comment #12
gg4 CreditAttribution: gg4 commented@chr.fritsch @daniel.bosen -- Let me know if you are able to reproduce this on a clean Drupal install.
Comment #13
gg4 CreditAttribution: gg4 commentedComment #14
extect CreditAttribution: extect commentedI can confirm the issue on 8.x-2.x.-dev with Drupal core media module. Once I create pinterest media content, I get several warnings that hint to the problem (see attachment).
Comment #15
extect CreditAttribution: extect commentedThe patch in #8 solves the issue. I have adapted it to 8.x-2.x-dev.
Comment #16
gg4 CreditAttribution: gg4 commented@extect Can you provide the steps taken to reproduce this issue on a clean Drupal install, not Thunder distro, if that is what you are using as other have mentioned in this thread?
Comment #17
gg4 CreditAttribution: gg4 commentedComment #18
chr.fritschOk, I reproduced that in plain Drupal.
After that, I have the same notices in my log.
Patch from #15 solves the problem.
Comment #19
gg4 CreditAttribution: gg4 commentedThanks @chr.fritsch -- confirmed this bug with your steps.
Comment #20
gg4 CreditAttribution: gg4 commentedPatches work for me. Will commit shortly.
Comment #23
gg4 CreditAttribution: gg4 commentedCommitted to both 8.x-1.x and 8.x-2.x