API metadata sometimes doesn't include published status

Created on 6 January 2024, 6 months ago
Updated 20 January 2024, 5 months ago

Problem/Motivation

Not sure this is a bug or by design but it needs to be handled in the page info code so adding this here.

I'm seeing some cases where the metadata from the API doesn't include published and published_revision but I'm not sure why, e.g.

Array
(
    [last_modified] => 2023-11-04T01:15:58
    [meta] => Array
        (
            [transition_revision] => 1
            [revision_count] => 1
            [seq_num] => 1
            [transitions] => Array
                (
                )

            [md5] => 076f62ab7a6425b38cf638e57cf133e0
            [content_timestamp] => 1699060555
            [byte_length] => 24758
            [revision_number] => 1
            [url] => /en/node/29
            [type] => content
            [highest_revision_number] => 1
            [date_timestamp] => 1699060557
        )

)

rather than

Array
(
    [last_modified] => 2024-01-06T17:21:45
    [meta] => Array
        (
            [revision_count] => 1
            [seq_num] => 3
            [transitions] => Array
                (
                )

            [md5] => 471ac638de7b1060b958a88ffa4060f5
            [published_revision] => 1
            [published] => 1
            [content_timestamp] => 1704560692
            [byte_length] => 26633
            [revision_number] => 1
            [url] => /en/recipes/fiery-chili-sauce2
            [type] => content
            [highest_revision_number] => 1
            [date_timestamp] => 1704561704
        )

)

Right now the page info code assumes published is available in the metadata so it's giving a Warning: Undefined array key "published" in Drupal\quant\Utility::getPageInfo() error so I'm trying to see the best way to handle this.

Steps to reproduce

TBD

Proposed resolution

TBD

Remaining tasks

  • Figure out why
  • Update code
  • Review and test
  • Commit :)

User interface changes

Won't see the Warning: Undefined array key "published" in Drupal\quant\Utility::getPageInfo() on some pages.

API changes

Data model changes

TBD

πŸ“Œ Task
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Kristen Pol Santa Cruz, CA, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024