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

Bug: Controlled Cells CLI command generates wrong filenames #7455

Closed
sanchawebo opened this issue Apr 26, 2023 · 4 comments
Closed

Bug: Controlled Cells CLI command generates wrong filenames #7455

sanchawebo opened this issue Apr 26, 2023 · 4 comments
Labels
duplicate Issue or pull request duplicates an already existing issue/pull request

Comments

@sanchawebo
Copy link
Contributor

sanchawebo commented Apr 26, 2023

PHP Version

8.2

CodeIgniter4 Version

4.3.1, 4.3.2, 4.3.3

CodeIgniter4 Installation Method

Composer (using codeigniter4/appstarter)

Which operating systems have you tested for this bug?

macOS

Which server did you use?

apache

Database

MySQL 5.7.39

What happened?

When generating a controlled cell via the php spark make:cell MyCell-command and echoing it into a site via <?= view_cell('MyCell') ?> CodeIgniter generates the following error:
include(/USERDIR/test_ci4-news/app/Cells/my.php): Failed to open stream: No such file or directory
The generated filenames are:

  • MyCell.php
  • my_cell.php

Steps to Reproduce

  • Install CI4 with composer
  • Generate a view_cell with the CLI command
  • Echo it inside welcome_message.php with <?= view_cell('MyCell') ?>

Expected Output

It should print out the following HTML-code:

<div>
    <h1>Cell works!</h1>
</div>

Anything else?

Followed the instructions at: https://codeigniter4.github.io/userguide/outgoing/view_cells.html#controlled-cells

Workaround/Functioning Code

If you rename the cell's viewfile to my.php, alas removing the '_cell' part, it works as expected

@sanchawebo sanchawebo added the bug Verified issues on the current code behavior or pull requests that will fix them label Apr 26, 2023
@sanchawebo sanchawebo changed the title Bug: Controlled Cells do not work Bug: Controlled Cells CLI command generates wrong filenames Apr 26, 2023
@kenjis kenjis added duplicate Issue or pull request duplicates an already existing issue/pull request and removed bug Verified issues on the current code behavior or pull requests that will fix them labels Apr 26, 2023
@kenjis
Copy link
Member

kenjis commented Apr 26, 2023

Duplicate of #7391

@kenjis kenjis marked this as a duplicate of #7391 Apr 26, 2023
@kenjis
Copy link
Member

kenjis commented Apr 26, 2023

Thanks for taking the time to fill out this bug report!

Before you begin, please ensure that there are no existing issues,
whether still open or closed, related to your report
.
If there is, your report will be closed promptly.

For example, if you get the error on View Cells,
you can search the GitHub repository with the keyword "view cells".

@kenjis kenjis closed this as completed Apr 26, 2023
@sanchawebo
Copy link
Contributor Author

Thanks for your reply but there were no open issues at the time and the linked issue is marked as closed but the bug still persists.

@kenjis
Copy link
Member

kenjis commented Apr 27, 2023

It was closed by #7392 and #7392 was merged into develop branch.
Try develop branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issue or pull request duplicates an already existing issue/pull request
Projects
None yet
Development

No branches or pull requests

2 participants