Skip to content

fix: [ViewCells] when there are cells with the same short name, only the first cell is loaded #7686

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

Merged
merged 2 commits into from
Jul 11, 2023

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Jul 9, 2023

Description
Fixes #7684

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@kenjis kenjis added the bug Verified issues on the current code behavior or pull requests that will fix them label Jul 9, 2023
@@ -178,7 +178,8 @@ protected function determineClass(string $library): array
}

// locate and return an instance of the cell
$object = Factories::cells($class);
// @TODO extend Factories to be able to load classes with the same short name.
$object = class_exists($class) ? new $class() : Factories::cells($class);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In v4.2.12, just new $class() was called:

// Not cached - so grab it...
$instance = new $class();

@kenjis kenjis merged commit d778ec3 into codeigniter4:develop Jul 11, 2023
@kenjis kenjis deleted the fix-view-cells-same-short-name branch July 11, 2023 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: [ViewCells] when there are cells with the same short name, only the first cell is loaded
2 participants