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

Fixed too few arguments exception thrown in the admin with using flex objects #3658

Merged
merged 1 commit into from
Oct 24, 2023

Conversation

augrinovska
Copy link
Contributor

@augrinovska augrinovska commented Dec 7, 2022

#3657

The following methods from the Grav\Common\Flex\Types\Pages\PageIndex object do not work as expected in Admin.

  • public function ofType($type)
  • public function ofOneOfTheseTypes($types)
  • public function ofOneOfTheseAccessLevels($accessLevels)

Preconditions and environment

  1. Grav CMS v1.7.37.1
  2. PHP 7.4

Steps to reproduce

  1. Load the Pages Collection of type 'default’ in the admin using the following code $grav['flex']->getCollection('pages')->ofType('default’)

Expected Result

The collection Grav\Common\Flex\Types\Pages\PageCollection is loaded with all the pages of a type ‘default’.

Actual Result

Too few arguments to function Grav\Common\Flex\Types\Pages\PageCollection::ofType(), 0 passed in grav-cms/system/src/Grav/Framework/Flex/FlexIndex.php on line 489 and exactly 1 expected

@augrinovska augrinovska changed the base branch from develop to master December 7, 2022 16:06
@rhukster rhukster requested a review from mahagr December 7, 2022 18:04
@rhukster
Copy link
Member

rhukster commented Dec 7, 2022

Thanks for this, will review and get back to you.

@rhukster rhukster merged commit 71939e1 into getgrav:master Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants