Site crash | Call to a member function getURL() on a non-object

Permalink Browser Info Environment
I'm getting an: "An unexpected error occurred. Call to a member function getURL() on a non-object" (screenshot:http://screencast.com/t/oiAEsgbkf)...

This happened when I added a image block, <saved> then deleted same image block a few minutes later after publishing.

Thanks,
Mark

Type: Ticket
Status: Archived
mstroz
View Replies:
c5hub replied on at Permalink Reply
c5hub
The image block is a core concrete5 block and not controlled or related to the theme.

If this issue persists you should submit a bug report to concrete5 and or post in the public forums to see if anyone else has encountered a similar issue.

Thanks
mstroz replied on at Permalink Reply
mstroz
Hi.

Regarding this issue I tried rolling it back. At first it wouldn't let me access versioning. I changed the theme and was able to roll it back. But when I changed the theme back I got the same error message again. Tried it twice.

If I uninstall & reinstall Fundamental is there a way to retain the customized settings?
Thanks,
Mark
mstroz replied on at Permalink Reply
mstroz
I've continued the discussion at 5.7 Discussion Forums as requested.https://www.concrete5.org/community/forums/5-7-discussion/site-crash...

Some are suggesting this is a Fundamental theme related issue. Can you help or join in the discussion?
Thanks,
Mark
exchangecore replied on at Permalink Reply
exchangecore
@c5hub can you take a look into this. The error that was posted at https://www.concrete5.org/community/forums/5-7-discussion/site-crash... seems to indicate a problem with one of the theme blocks.
c5hub replied on at Permalink Reply
c5hub
Our first assumption based on the description of the support ticket was this was related to the core image block. Reading your community forum post this sounds like this may not be the root cause of your issues. We will investigate further and let you know what we discover. .
Thanks.
c5hub replied on at Permalink Reply
c5hub
We have been looking at the code in the section block controller and the test to see if an image has been set looks appropriate. May I ask, did you delete any images from your file manager? It seems that maybe the background image is set in the section block but the file no longer exists in the file manager.
mstroz replied on at Permalink Reply
mstroz
Hi,

Yes. Right after the crash, I went to the file manager and deleted the JPG. Troubleshooting, I uploaded the same JPG later.

Something else that may be helpful. In the Dashboard, I don't get a response when I select Settings. However, when I activate a different theme, I can access Settings and rollback to an earlier version. But when I switch back to Fundamental I still get the same error message.
Thanks,
Mark
c5hub replied on at Permalink Reply
c5hub
The issue here sounds like you had a problem with adding/deleting a core image block and then you deleted an image which was also used in a section block on your page. As the images are assigned by ID and not name, re-uploading this would not fix the issue.

It seems as though this section block in now left in limbo with an image assigned that no longer exists, hence the error you can see.

Had you done much work to the site before the error? Uninstalling the theme and re-installing may solve the issue but any changes you had made would be lost.
c5hub replied on at Permalink Reply
c5hub
To get your site back up and running, we may just have a solution - this will involve amending a file in the package.

If you could open this file
packages/fundamental/blocks/fundamental_section/controller.php

Then online 152 change...
if($this->sectionBackgroundImage) {
   $file = $this->getFileObject();
   $file = $file->getURL();
   $backgroundImage = 'background-image:url('.$file.');background-repeat:'.$this->sectionBackgroundImageRepeat.';background-size:'.$backgroundSize.';background-attachment:'.$backgroundmentAttachment.';';
   $this->set('backgroundImage', $backgroundImage);
}

to...
if($this->sectionBackgroundImage) {
   $file = $this->getFileObject();
   if($file) {
      $file = $file->getURL();
   }
   $backgroundImage = 'background-image:url('.$file.');background-repeat:'.$this->sectionBackgroundImageRepeat.';background-size:'.$backgroundSize.';background-attachment:'.$backgroundmentAttachment.';';
   $this->set('backgroundImage', $backgroundImage);
}

This may get your site back up and running. Once you have done this, you should either delete the section block on the page or change the image to one that exists...

Thanks
c5hub replied on at Permalink Reply
c5hub
Upgrading the package to 2.0.4 should also solve your issue...
mstroz replied on at Permalink Reply
mstroz
Hi,

Apologies for the delayed response.

I made the update today. Thank you for your help!
Best regards,
Mark

On Monday, August 3, 2015, concrete5 Community <discussions@concretecms.com>
wrote:
ConcreteCMS replied on at Permalink Reply
ConcreteCMS
Attention: Since there has been no activity on this issue for two weeks, this issue has been automatically archived.

To re-open this issue, reply to this message.

concrete5 Environment Information

# concrete5 Version
Core Version - 5.7.3.1
Version Installed - 5.7.3.1
Database Version - 20150109000000

# concrete5 Packages
Fruitful (1.2), Fundamental (2.0.3), Open Graph Tags Lite (2.0.2).

# concrete5 Overrides
languages/da_DK, languages/de_DE, languages/el_GR, languages/fi_FI, languages/fr_FR, languages/it_IT, languages/ja_JP, languages/nl_NL, languages/ru_RU, languages/sl_SI, languages/sv_SE, languages/tr_TR

# concrete5 Cache Settings
Block Cache - Off
Overrides Cache - Off
Full Page Caching - Off
Full Page Cache Lifetime - Every 3 minutes.

# Server Software
Apache

# Server API
cgi-fcgi

# PHP Version
5.3.28

# PHP Extensions
bz2, calendar, cgi-fcgi, Core, ctype, curl, date, dom, ereg, exif, fileinfo, filter, ftp, gd, gettext, gmp, hash, iconv, imap, ionCube Loader, json, libxml, mbstring, mcrypt, mysql, mysqli, openssl, pcntl, pcre, PDO, pdo_mysql, pdo_sqlite, Phar, readline, Reflection, session, shmop, SimpleXML, sockets, SPL, sqlite3, standard, tokenizer, wddx, xml, xmlreader, xmlwriter, xsl, zip, zlib.

# PHP Settings
max_execution_time - 60
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 - 8M
safe_mode - Off
safe_mode_exec_dir - <i>no value</i>
safe_mode_gid - Off
safe_mode_include_dir - <i>no value</i>
sql.safe_mode - Off
upload_max_filesize - 128M
mysql.max_links - Unlimited
mysql.max_persistent - Unlimited
mysqli.max_links - Unlimited
mysqli.max_persistent - Unlimited
pcre.backtrack_limit - 1000000
pcre.recursion_limit - 100000
session.cache_limiter - <i>no value</i>
session.gc_maxlifetime - 1440
safe_mode_allowed_env_vars - PHP_
safe_mode_protected_env_vars - LD_LIBRARY_PATH

Browser User-Agent String

Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.