Entity of type 'Concrete\Core\Entity\File\File' for IDs fID(xxx) was not found

Permalink 7 0 Browser Info Environment
Create page with a default tumbnail attribute and upload an image file. Publish
Remove image file from file manager.

Page goes bye bye.
Entity of type 'Concrete\Core\Entity\File\File' for IDs fID(xxx) was not found
Backend -> sitemap -> edit is broken too.


Status: New
c5dragon
c5dragon replied on at Permalink Reply
c5dragon
Medon replied on at Permalink Reply
Medon
Got the same thing
frankdesign replied on at Permalink Reply
Needed to change core to fix problems that occurred after files deleted could not revert deleted as client had made other changes:

This was all instances of files upload to version 5.7.5 in 2017 were deleted:

$page->getAttribute('thumbnail');

was returning

DoctrineProxies\__CG__\Concrete\Core\Entity\File\File

being returned for deleted files instead of .

null

Please could this problem be fixed as a matter of urgency.

concrete/src/Application/Service/FileManager.php
line 73:
- } elseif (is_object($preselectedFile)) {
+ } elseif (get_class($preselectedFile) == 'Concrete\Core\Entity\File\File') {

concrete/src/Editor/LinkAbstractor.php

line 125:
- if ($fo !== null) {
+ if (get_class($fo) == 'Concrete\Core\Entity\File\File') {

concrete/attributes/image_file/controller.php

line 103:

- if (is_object($value)) {
+ if (get_class($value) == 'Concrete\Core\Entity\File\File' ) {

concrete/src/File/Image/BasicThumbnailer.php

line 263:
- if ($obj instanceof File) {
+ if (is_object($obj) and get_class($obj) == 'Concrete\Core\Entity\File\File' ) {

packages/open_graph_tags_lite/src/Html/OpenGraphTags.php
}

$og_image = $page->getAttribute('og_image');
- if (!is_object($og_image)) {
+ if (!get_class($og_image) == 'Concrete\Core\Entity\File\File') {
$og_image = $page->getAttribute('thumbnail');
- if (!is_object($og_image) && !empty($thumbnailID)) {
+ if (!get_class($og_image) == 'Concrete\Core\Entity\File\File' && !empty($thumbnailID)) {
$og_image = File::getByID($thumbnailID);
}
}

- if (is_object($og_image) && !$og_image->isError()) {
+ if (get_class($og_image) == 'Concrete\Core\Entity\File\File' && !$og_image->isError()) {
$og_image_width = $og_image->getAttribute('width');
$og_image_height = $og_image->getAttribute('height');
$og_image_url = $og_image->getURL();










$og_image = $page->getAttribute('og_image');
if (!get_class($og_image) == 'Concrete\Core\Entity\File\File') {
$og_image = $page->getAttribute('thumbnail');
if (!get_class($og_image) == 'Concrete\Core\Entity\File\File' && !empty($thumbnailID)) {
$og_image = File::getByID($thumbnailID);
}
}

if (get_class($og_image) == 'Concrete\Core\Entity\File\File' && !$og_image->isError()) {
$og_image_width = $og_image->getAttribute('width');
$og_image_height = $og_image->getAttribute('height');
$og_image_url = $og_image->getURL();
}

$pageTwitterCard = $page->getCollectionAttributeValue('twitter_card');
if (!$pageTwitterCard) {
if (isset($og_image_width) && $og_image_width > 280) {
$pageTwitterCard = 'summary_large_image';
} else {
$pageTwitterCard = 'summary';
}
}

Tried a few things turned on:

On - Proxy classes will be generated on the fly. Good for development.

deleted

application/config/doctrine

This folder was remade.

Tried running this code in document root:

concrete/bin/concrete5 orm:generate-proxies

Any other ideas out there welcome do not wish to keep changing the core to cope with this.

concrete5 Environment Information

# concrete5 Version
Core Version - 8.5.0
Version Installed - 8.5.0
Database Version - 20190301133300

# concrete5 Packages
CKE Accessibility Checker (1.0.1), Event Calendar PRO (2.3.19), Fileset Attribute (0.7), List files from set (1.0.12), Notification Bar (0.0.9.1), Page Redirect (2.0), Page Selector Attribute (2.0)

# concrete5 Overrides
blocks/google_map/view.css, blocks/google_map/icon.png, blocks/google_map/view.php, blocks/google_map/controller.php, blocks/google_map, blocks/date_navigation/view.php, blocks/date_navigation, blocks/core_conversation/view.php, blocks/core_conversation, blocks/faq/templates/panels/view.css, blocks/faq/templates/panels/view.php, blocks/faq/templates/panels, blocks/faq/templates, blocks/faq, blocks/conversation_list/icon.png, blocks/conversation_list/form.php, blocks/conversation_list/db.xml, blocks/conversation_list/view.php, blocks/conversation_list/add.php, blocks/conversation_list/edit.php, blocks/conversation_list/controller.php, blocks/conversation_list, blocks/event_calendar_list/view.css, blocks/event_calendar_list/icon.png, blocks/event_calendar_list/db.xml, blocks/event_calendar_list/css/fullcalendar.min.css, blocks/event_calendar_list/css/style.css, blocks/event_calendar_list/css/style.css.map, blocks/event_calendar_list/css, blocks/event_calendar_list/images/switch.png, blocks/event_calendar_list/images, blocks/event_calendar_list/view.php, blocks/event_calendar_list/form_setup_html.php, blocks/event_calendar_list/js/dsEventCalendarBlock.js, blocks/event_calendar_list/js, blocks/event_calendar_list/add.php, blocks/event_calendar_list/edit.php, blocks/event_calendar_list/controller.php, blocks/event_calendar_list/auto.js, blocks/event_calendar_list, blocks/topic_list/view.php, blocks/topic_list, blocks/list_files_from_set/view.php, blocks/list_files_from_set, blocks/file/view.php, blocks/file, elements/conversation/message/author.php, elements/conversation/message/add_form.php, elements/conversation/message, elements/conversation/display.php, elements/conversation/message.php, elements/conversation, tools/conversations/add_message.php, tools/conversations

# concrete5 Cache Settings
Block Cache - On
Overrides Cache - On
Full Page Caching - On - If blocks on the particular page allow it.
Full Page Cache Lifetime - Every 6 hours (default setting).

# Server Software
Apache

# Server API
cgi-fcgi

# PHP Version
7.1.27

# PHP Extensions
bcmath, bz2, calendar, cgi-fcgi, Core, ctype, curl, date, dba, dom, enchant, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, imagick, imap, intl, ionCube Loader, json, ldap, libxml, mbstring, mcrypt, mysqli, mysqlnd, odbc, openssl, pcntl, pcre, PDO, pdo_mysql, PDO_ODBC, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, pspell, readline, redis, Reflection, session, SimpleXML, soap, sockets, sodium, SPL, sqlite3, standard, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend OPcache, zip, zlib

# PHP Settings
max_execution_time - 30
log_errors_max_len - 1024
max_file_uploads - 20
max_input_nesting_level - 64
max_input_time - 60
max_input_vars - 1000
memory_limit - 128M
post_max_size - 24M
sql.safe_mode - Off
upload_max_filesize - 48M
ldap.max_links - Unlimited
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
odbc.max_links - Unlimited
odbc.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
pgsql.max_links - Unlimited
pgsql.max_persistent - Unlimited
session.cache_limiter - <i>no value</i>
session.gc_maxlifetime - 7200
soap.wsdl_cache_limit - 5
opcache.max_accelerated_files - 10000
opcache.max_file_size - 0
opcache.max_wasted_percentage - 5

Browser User-Agent String

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36