Error: getUserName() on a non-object

Permalink Browser Info Environment
I am getting this error message when trying to look up the individual records. Also in the exported cvs file, no records are present, i get the same message.
Fatal error: Call to a member function getUserName() on a non-object in/home/..../public_html/packages/sixeightforms/models/answer_set.phpon line 516

Type: Pre-Sale
Status: In Progress
lclausen
View Replies:
lesccseh replied on at Permalink Reply
lesccseh
This happen because the visitors that filling the forms not signed in the site and the function and User::getUserByID() return a null value instea of an object so in the next line crash accessing the property

We have workarround this and seems working properly now

sixeightforms\models\answer_set.php
line 516

public function getOwnerUserName() {
$uID = $this->creator;
$u = User::getByUserID($uID);
if(!$u){return "not-signed-in";}; /* insert this line to workaround the issue*/
return $u->getUserName();

I hope it get fixed in the Next version.

Regards,

Pablo Botella

concrete5 Environment Information

# concrete5 Version
5.6.3.3

# concrete5 Packages
Advanced Forms (1.11.5), Autonav Exclude Subpages (1.2), Awkward Slider (1.0.4), Bootstrap (3.1.1.1), Bootstrap Image Gallery (1.2), Breadcrumbs (2.0), C25 Theme (1.0), Calendar Nav (1.0.8), ChadStrat's Live Search (2.0.6), Comments Moderation (2.0.2), Designer Content (3.1.1), Disqus Comments (0.5.1), Event Calendar (2.0.11), Facebook Like Button (1.1), FlexSlider (2.1.1), Highslide Web Albums (2.7), Image Slider (1.1), Intense Debate Comments (0.3.1), Load jQuery UI (1.4.2), Long Story Short Parallax (1.3.3), Mosaic Gallery (1.2.1), Nivo Slider (2.0.1), Owl slider Manager (0.9.6), Page Auto Redirect (2.0), Page Redirect (1.4), Page Selector Attribute (1.1), PC5 Custom Templates (3.5), Pro Forms (6.2.0), Publication Link (0.9.0), Responsive Image (1.0.1), Simple Blog (4.2.1), Sortable Fancybox Gallery (1.17), Sortable Responsive Gallery (1.8), Spacer / Margin (0.9.0.6), tcPhotoGallery (1.4.1), tcSlider (2.2.9), VR Tabs Lite (0.9.8), Whale Nivo Image Slider (1.1).

# concrete5 Overrides
blocks/stj_op_media_block, blocks/stj_outer_three_images_row, blocks/stj_op_fullscreencarousel, blocks/stj_inner_content_block, blocks/stj_image_block, blocks/stj_op_events_buttons, blocks/stj_featured_box, blocks/stj_inner_titletwoblocks_content, blocks/stj_cat_image_text_box_horizonta, blocks/stj_op_topnavbar_item, blocks/stj_home_right_menu, blocks/stj_op_news_item_section, blocks/stj_home_featured_outer, blocks/stj_ask_a_sudent_block, blocks/stj_inner_three_images_row, blocks/stj_op_three_blocks_section, blocks/stj_op_slideritem_section, blocks/stj_op_events_item, blocks/sjc_master_slider, blocks/stj_two_column_content, blocks/stj_inner_row_image_text, blocks/stj_header_top_nav_item, blocks/stj_op_history_block, blocks/stj_cat_image_text_box_vertical, blocks/core_stack_display, blocks/stj_home_slide, blocks/stj_inner_content_blockg, blocks/stj_inner_two_blocks_content, blocks/stj_outer_content_block, blocks/stj_outer_three_images_text_row, blocks/stj_home_image_box, blocks/search, blocks/stj_inner_content_two_clmn_mixed, blocks/stj_inner_three_images_text_row, blocks/stj_home_image_youtube_box, blocks/stj_master_slider, blocks/stj_stringfellow_row, blocks/stj_buttons_row, blocks/autonav, blocks/stj_op_next_link, blocks/stj_stories_image_text_box, blocks/stj_inner_four_images_text_row, elements/nojs_page_controls_header.php, elements/header_required.php, elements/nojq_header_required.php, elements/footer_required.php, elements/page_controls_header.php, helpers/Sidebar.php, tools/required, tools/sixeightforms, tools/test.php

# concrete5 Cache Settings
Block Cache - Off
Overrides Cache - Off
Full Page Caching - Off

# Server Software
Apache/2.4.10 (Unix) OpenSSL/1.0.1e-fips mod_bwlimited/1.4

# Server API
cgi-fcgi

# PHP Version
5.4.36

# PHP Extensions
bcmath, calendar, cgi-fcgi, Core, ctype, curl, date, dom, ereg, exif, filter, ftp, gd, gettext, hash, iconv, imap, ionCube Loader, json, libxml, mbstring, mcrypt, mysql, mysqli, mysqlnd, openssl, pcre, PDO, pdo_mysql, pdo_sqlite, Phar, posix, Reflection, session, SimpleXML, sockets, SPL, sqlite3, standard, suhosin, tokenizer, xml, xmlreader, xmlwriter, Zend Guard Loader, 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 - 256M
sql.safe_mode - Off
upload_max_filesize - 256M
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 - nocache
session.gc_maxlifetime - 7200
suhosin.cookie.max_array_depth - 50
suhosin.cookie.max_array_index_length - 64
suhosin.cookie.max_name_length - 64
suhosin.cookie.max_totalname_length - 256
suhosin.cookie.max_value_length - 10000
suhosin.cookie.max_vars - 100
suhosin.executor.include.max_traversal - 0
suhosin.executor.max_depth - 0
suhosin.get.max_array_depth - 50
suhosin.get.max_array_index_length - 64
suhosin.get.max_name_length - 64
suhosin.get.max_totalname_length - 256
suhosin.get.max_value_length - 512
suhosin.get.max_vars - 100
suhosin.log.phpscript.is_safe - Off
suhosin.memory_limit - 0
suhosin.post.max_array_depth - 50
suhosin.post.max_array_index_length - 64
suhosin.post.max_name_length - 64
suhosin.post.max_totalname_length - 256
suhosin.post.max_value_length - 1000000
suhosin.post.max_vars - 1000
suhosin.request.max_array_depth - 50
suhosin.request.max_array_index_length - 64
suhosin.request.max_totalname_length - 256
suhosin.request.max_value_length - 1000000
suhosin.request.max_varname_length - 64
suhosin.request.max_vars - 1000
suhosin.session.max_id_length - 128
suhosin.upload.max_uploads - 25

Browser User-Agent String

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 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 have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.