Skip to content

SDK: getCollection Method has missing default values #28830

Closed

Description

@zJaaal

Parent Issue

#28415

Problem Statement

The query for the Content API in GetCollection is missing default value for live and languageId fields

Steps to Reproduce

Use the new Content API exposed in dotCMS Client and make a fetch with the getCollection method, in the network tab you should see that live and languageId do not have default values.

Query Example

     client.content
            .getCollection("Blog")
            .sortBy([
                {
                    field: "modDate",
                    order: "desc",
                },
            ])
            .limit(3)
            .then((response) => {
                console.log(response);
            })
            .catch((error) => {
                console.error(`Error fetching Blogs`, error);
            });

Query sent by that call ( See that we are not sending live and languageId)

{
    "query": "+contentType:Blog",
    "render": false,
    "sort": "modDate desc",
    "limit": 3,
    "offset": 0,
    "depth": 0
}

Acceptance Criteria

The query should contain +live:true and +languageId:1 as default values.

dotCMS Version

trunk-latest

Proposed Objective

Technical User Experience

Proposed Priority

Priority 3 - Average

Activity

  1. moved this from New to Next 1-3 Sprints in dotCMS - Product Planningon Jun 10, 2024
  2. self-assigned this
    on Jun 11, 2024
  3. moved this from Next 1-3 Sprints to In Progress in dotCMS - Product Planningon Jun 11, 2024
  4. moved this from In Progress to In Review in dotCMS - Product Planningon Jun 11, 2024
  5. moved this from In Review to Internal QA in dotCMS - Product Planningon Jun 11, 2024
  6. self-assigned this
    on Jun 14, 2024
  7. moved this from Internal QA to QA - Backlog in dotCMS - Product Planningon Jun 14, 2024
  8. rjvelazco commented on Jun 14, 2024

    @rjvelazco
    Member

    Passed Internal QA

    • Tested on docker: [dotcms/trunk_1895cd3]

    Video

    issue-28830-sdk-getcollection-method-has-missing-default-values.mov
  9. bryanboza commented on Jun 17, 2024

    @bryanboza
    Contributor

    Fixed tested on Docker [ dotcms/ trunk_635d690 ]

  10. moved this from QA - Backlog to Done in dotCMS - Product Planningon Jun 17, 2024
  11. changed the title [-]SDK: `getCollection` Method has missing default values [/-] [+]SDK: `getCollection` Method has missing default values[/+] on Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions