Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

We're calling a method (having) that doesn't exist on DataList #417

Closed
sabina-talipova opened this issue Oct 9, 2023 · 6 comments
Closed

Comments

@sabina-talipova
Copy link
Contributor

sabina-talipova commented Oct 9, 2023

Description

Method having() doesn't exist in DataList class, but we're trying to call it If Versioned::Versions() receives $having parameter.

We need to either add that method to DataList or apply the $having argument via alterDataQuery()

See

public function Versions($filter = "", $sort = "", $limit = "", $join = "", $having = "")
{
/** @var DataObject $owner */
$owner = $this->owner;
// When an object is not yet in the Database, we can't get its versions
if (!$owner->isInDB()) {
return ArrayList::create();
}
// Make sure the table names are not postfixed (e.g. _Live)
$oldMode = static::get_reading_mode();
static::set_stage(static::DRAFT);
$list = DataObject::get(DataObject::getSchema()->baseDataClass($owner), $filter, $sort, $join, $limit);
if ($having) {
// @todo - This method doesn't exist on DataList
$list->having($having);
}

Acceptance criteria

  • The $having argument in Versioned::Versions() can be called without throwing an exception and can be meaningfully use.

Note

We are assuming that this can be done relatively easily. But if it turns out to be very difficult, bring it back for re-refinement.

PR

@GuySartorelli GuySartorelli changed the title TODO: having method doesn't exist on DataList We're calling a method (having) that doesn't exist on DataList Oct 19, 2023
@GuySartorelli
Copy link
Member

Marking as impact/high.
This would be a critical in other circumstances, but the fact that this hasn't caused actual problems until now mitigates its impact somewhat.

@GuySartorelli
Copy link
Member

PR merged. Reassigning to Steve to add a note to the PR about the deprecated parameter.

@emteknetnz
Copy link
Member

Reassigning to Steve to add a note to the PR about the deprecated parameter.

Not sure what I'm supposed to do here?

@GuySartorelli
Copy link
Member

Changelog, sorry.

@emteknetnz
Copy link
Member

PR added

@emteknetnz emteknetnz removed their assignment Nov 6, 2023
@GuySartorelli
Copy link
Member

PRs merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants