Blank site name and missing theme logo give a bad manifest text and a broken logo image
Part of #3596034 (closed).
Problem/Motivation
- With "Site/Org Name" blank the config holds an empty string, so the
??fallback to the system site name never applies. Found inC2paSignSubscriber.phpand twice inc2pa_sign.module. - When the theme has no logo,
c2pa_sign_get_logo()returns an empty URL for the form and the docroot directory as the icon file. c2patool then fails withresource not found: /var/www/html/web, on every version from 0.9.12 to 0.28.2. - With "Claim generator" blank,
claim_generator_infois an empty array. c2patool 0.10.2 and 0.20.0 panic on it (index out of bounds), and PHP warns "Undefined array key 0".
Steps to reproduce
-
Leave "Site/Org Name" and "Claim generator" blank, clear the logo setting and use a theme without a logo.
-
Upload an image. Signing fails with
resource not found. -
Set a logo, derive an image and read it with
c2patool. The assertion says:"generation": "Image derivative generated for file rich.jpg in style E2E meta jpg at site ." -
Open
/admin/config/media/c2pa_sign. The logo preview is broken:<img width="50px" src="http://example.com/">
Seen with 1.4.11 and 1.x, c2patool 0.9.12 to 0.28.2, Drupal 11.4.
Proposed resolution
- Fall back on empty values too.
- Add the icon and the preview only when a logo file exists.
- Always write one
claim_generator_infoentry, named after the claim generator, then the site name, then "Drupal".
Definition of done
- Blank "Site/Org Name" gives the system site name in every assertion
- Blank "Claim generator" gives exactly one
claim_generator_infoentry, with no PHP warning - No logo gives no icon in the manifest, no preview in the form, and signing succeeds
- Kernel test for the three cases, run by CI
Testing instructions
- Repeat the steps above with c2patool 0.27.x or 0.28.x. Signing succeeds.
c2patool file.jpgshowsclaim_generator_info[0].nameequal to the site name and noicon./admin/reports/dbloghas no "Undefined array key" entry.- The settings form has no
<img>under the logo field.
AI Compliance
🤖 Generated with the help of an LLM, reviewed and approved by me before posting.
Edited by Giorgio Alfredo Pagano