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

Error adding a File field or image field to the custom columns on the entries list. #2335

Closed
studionigh opened this issue Aug 26, 2022 · 1 comment · Fixed by #2336
Closed
Labels
Bug: Accepted Bug has been confirmed, is reproducible, and ready to work on.

Comments

@studionigh
Copy link

Description of the problem
I have a channel for Apps, and within the channel, I have a field for the apps logo. I thought it would be great to see the logo as part of the columns on the listing view of the entries. I have tried this on two different sites, and one has a warning but shows the URL to the image:

Notice
Undefined index: title
ee/ExpressionEngine/Addons/file/ft.file.php, line 1004

Severity: E_NOTICE
Warning
Cannot modify header information - headers already sent by (output started at ee/legacy/core/Exceptions.php:120)
ee/ExpressionEngine/Boot/boot.common.php, line 476

Severity: E_WARNING

And the other site shows an error, and now I am not able to see any entries in that channel:

Error Caught
Call to a member function toArray() on null
ee/legacy/libraries/File_field.php:619

Stack Trace: Please include when reporting this error
#0 ee/legacy/libraries/File_field.php(656): File_field->get_file('898')
#1 ee/ExpressionEngine/Addons/file/ft.file.php(262): File_field->parse_field('{file:898:url}')
#2 ee/ExpressionEngine/Addons/file/ft.file.php(1003): File_ft->pre_process('{file:898:url}')
#3 ee/ExpressionEngine/Model/Content/FieldFacade.php(462): File_ft->renderTableCell('{file:898:url}', 107, Object(ExpressionEngine\Addons\Pro\Model\Channel\ChannelEntry))
#4 ee/ExpressionEngine/Library/CP/EntryManager/Columns/CustomField.php(68): ExpressionEngine\Model\Content\FieldFacade->renderTableCell('{file:898:url}', 107, Object(ExpressionEngine\Addons\Pro\Model\Channel\ChannelEntry))
#5 ee/ExpressionEngine/Library/CP/EntryManager/ColumnRenderer.php(58): ExpressionEngine\Library\CP\EntryManager\Columns\CustomField->renderTableCell(NULL, NULL, Object(ExpressionEngine\Addons\Pro\Model\Channel\ChannelEntry), 'list', false)
#6 [internal function]: ExpressionEngine\Library\CP\EntryManager\ColumnRenderer->ExpressionEngine\Library\CP\EntryManager\{closure}(Object(ExpressionEngine\Library\CP\EntryManager\Columns\CustomField))
#7 ee/ExpressionEngine/Library/CP/EntryManager/ColumnRenderer.php(59): array_map(Object(Closure), Array)
#8 ee/ExpressionEngine/Controller/Publish/Edit.php(206): ExpressionEngine\Library\CP\EntryManager\ColumnRenderer->getRenderedTableRowForEntry(Object(ExpressionEngine\Addons\Pro\Model\Channel\ChannelEntry))
#9 [internal function]: ExpressionEngine\Controller\Publish\Edit->index()
#10 ee/ExpressionEngine/Core/Core.php(268): call_user_func_array(Array, Array)
#11 ee/ExpressionEngine/Core/Core.php(124): ExpressionEngine\Core\Core->runController(Array)
#12 ee/ExpressionEngine/Boot/boot.php(184): ExpressionEngine\Core\Core->run(Object(ExpressionEngine\Core\Request))
#13 admin.php(154): require_once('...')
#13 admin.php(154): require_once('...')

How To Reproduce
Steps to reproduce the behavior:

  1. adding a file field or image

Screenshots / Videos / Template Code

Environment Details:

  • Version: 7.1.2
  • PHP Version 7.4.30
  • MySQL Version 10.3.36-MariaDB
  • OS: Mac
  • Web Server: Apache Version | 2.4.54

Possible Solution

Additional context

@intoeetive intoeetive added the Bug: Accepted Bug has been confirmed, is reproducible, and ready to work on. label Aug 26, 2022
intoeetive added a commit that referenced this issue Aug 26, 2022
…field could case PHP error in Entry Manager listing
@intoeetive
Copy link
Contributor

@studionigh thank you for the report.

This seems to be related to the fact that at least in one entry the fields are pointing to the files that do not exist. The pull request referenced here will fix the issue

intoeetive added a commit that referenced this issue Aug 31, 2022
…field could case PHP error in Entry Manager listing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Accepted Bug has been confirmed, is reproducible, and ready to work on.
Projects
None yet
2 participants