Page MenuHomePhabricator

Fallback template does not apply if Citoid returns empty string for title field
Open, Needs TriagePublic

Description

According to the Citoid documentation, the title field is one of the mandatory fields. However, this doesn't prevent it from returning an empty string for this field. See for example this and this cases.

However, Web2Cit does not accept an empty string as output value for the title field. As a result, if given to Web2Cit, no citation is returned for these URLs (not even using the fallback template).

Event Timeline

diegodlh renamed this task from Consider revising title validation to accept empty strings to Fallback template does not apply if Citoid returns empty string for title field.Aug 31 2022, 2:24 PM
diegodlh added a project: Web2Cit (Grant end).

Note this wouldn't be a problem if T305168 was addressed.

Some New Zealand websites where citoid fails to find a title or fails for some other reason:

Paperspast (example item https://paperspast.natlib.govt.nz/newspapers/AG19240126.2.51)
Dictionary of New Zealand biography (example item https://teara.govt.nz/en/biographies/4g2/galbraith-alexander)

Thank you @DrThneed for reporting those sites.

Citoid does indeed return no title for https://paperspast.natlib.govt.nz/newspapers/AG19240126.2.51, so that would be the reason why Web2Cit does not return a citation, as described above.

Regarding https://teara.govt.nz/en/biographies/4g2/galbraith-alexander, the reason why Web2Cit fallback template does not apply in this case is not because Citoid is returning an empty title, but rather because Citoid is failing altogether with a 404 (Not Found) error.[1] This can be seen in https://en.wikipedia.org/api/rest_v1/#/Citation/getCitation. As a result, not even the Citoid citation is shown in the visual editor's insert citation dialog. This is similar to what has been reported in T312909.

[1] Note that since T305163 has been resolved this Citoid error does not necessarily result in a Web2Cit error.