Closed bryanpizzillo closed 1 year ago
This error appears to be happening because CgovCoreTwigExtensions::getImageData()
is receiving a URL encoded file name and failing to decode it before attempting to get information from the file system. (e.g. Healthy%20lifestyle_0.jpg
vs Healthy lifestyle_0.jpg
)
The error can be reproduced locally under that circumstance.
docroot/profiles/custom/cgov_site/modules/custom/cgov_yaml_content/content/300_press_release.content.yml
, at line 185, change the filename for "The BRCA Exchange graphic" from BRCA-exchange-article.jpg
to BRCA exchange article.jpg
blt cgov:reinstall --no-interaction
.http://www.devbox/news-events
and note that the image still appears.http://www.devbox/PublishedContent/RSS/syndication/rss/ncinewsreleases.rss
enclosure
element for the "BRCA Exchange aggregates data on thousands of BRCA variants to inform understanding of cancer risk" entry will have:
length
attributetype
attribute of "application/octet-stream"http://www.devbox/user/login
http://www.devbox/admin/reports/dblog
cp 'BRCA exchange article.jpg' BRCA%20exchange%20article.jpg
drush cr
http://www.devbox/PublishedContent/RSS/syndication/rss/ncinewsreleases.rss
enclosure
element now has:
length
attribute of 17221type
attribute of "image/jpeg"The place where this is dying is
Issue description
An error appeared in the logs unable to get the file size of an image that is being used for an enclosure for an RSS feed item. The enclosure item gets a
length=""
which is not correct. ADDITIONALLY, the mime type is incorrect when the length is empty, it should be the graphics type and nottype="application/octet-stream"
. The root cause is that there is no good, and supported way, to do this in Drupal, see https://www.drupal.org/project/drupal/issues/3150318.Error message:
Feed output for https://www.cancer.gov/PublishedContent/RSS/syndication/rss/ncinewsreleases.rss: