Skip to content

Model the article options (attribs) in the create/update schema #37

Description

@tecpromotion

Summary

The article "Options" (the attribs registry) are not modelled in the generated create/update schema, so a client cannot set an article's display options through the MCP tools, although the established web services accept them on write.

Background

attribs is stored in the #__content.attribs column and bound by ArticleModel on save (new Registry($item->attribs)). It is a registry of many display sub-options, mirrored by the "Options" fieldset in administrator/components/com_content/forms/article.xml — for example show_title, link_titles, show_intro, info_block_position, show_category, link_category, show_author, link_author, show_create_date, article_layout, alternative_readmore.

The web services accept these on write; the Article resource does not declare them, so content.articles.create / content.articles.update cannot set them.

Note: attribs is not part of the read output either — it is not in JsonapiView::$fieldsToRenderItem/$fieldsToRenderList — so any modelling of it would be write-only, like articletext, catid and ordering.

Proposed approaches

  • Add an ArticleOptions value object (like ArticleImage / ArticleUrls / ArticleMetadata) that declares each option with its type and default, hidden from read and list where the web services never render it.
  • Or expose attribs as a free-form object and let the model validate it, accepting less schema precision.

Scope

Deferred from the current article CRUD slice; a larger sub-field surface than a single property. Related to the custom-fields write limitation (#36): both are "extra write data the web services accept that the contract does not yet fully describe".

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions