Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Fatal error: Cannot use object of type xthreads_db_binary_value as array in...
anhmjn Offline
Junior Member
**
Posts: 5
Joined: Aug 2014
Post: #1
Question Fatal error: Cannot use object of type xthreads_db_binary_value as array in...
Hi everybody, This error shows up when I upload some image (using xthread):

PHP Code:
Fatal error: Cannot use object of type xthreads_db_binary_value as array in E:\xampp\htdocs\mybb18beta3\inc\plugins\xthreads.php on line 762


i'm running mybb 1.8 beta 3 and xthread 1.6.3.

08-21-2014 12:40 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: Fatal error: Cannot use object of type xthreads_db_binary_value as array in...
Thanks for finding that.

Try editing inc/plugins/xthreads.php, find:

PHP Code:
		$md5hash = $xta['md5hash'];
		if(isset($md5hash{15}) && !isset($md5hash{16})) {
			$md5hash = bin2hex($md5hash);
		} elseif(!isset($md5hash{31}) || isset($md5hash{32}))
			$md5hash = '';

replace with

PHP Code:
1
2
3
4
5
6
7
		$md5hash = $xta['md5hash'];
		if(is_object($md5hash)) // assume xthreads_db_binary_value
			$md5hash = bin2hex($md5hash->__toString());
		elseif(isset($md5hash{15}) && !isset($md5hash{16}))
			$md5hash = bin2hex($md5hash);
		elseif(!isset($md5hash{31}) || isset($md5hash{32}))
			$md5hash = '';


See if that fixes it.


My Blog
08-22-2014 09:45 AM
Find all posts by this user Quote this message in a reply
anhmjn Offline
Junior Member
**
Posts: 5
Joined: Aug 2014
Post: #3
RE: Fatal error: Cannot use object of type xthreads_db_binary_value as array in...
Thanks, it's working now.

But i have problem when upload a long filename.
Ex:

Code:
hhcb3pu5lGFcinfq3sc8Pi7v85Vb5KGRq6KrlDdcttCswplxmyJ005fPCdWsLYTI3XHV-zH2wKwKznko0pga6A.jpg

86 characters - working fine

Code:
hhcb3pu5lGFcinfq3sc8Pi7v85Vb5KGRq6KrlDdcttCwct6-FChLqGoSzh46AhUjnPy3Kea00_u9bAoMz82XVxwAcRMiTLOJbsfbbjtv-L0EmdHV3YTlr9SOpiKs_WKi.jpg

128 characters - Thumbnail not show up, it's say: Specified attachment not found.

   

08-22-2014 12:39 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #4
RE: Fatal error: Cannot use object of type xthreads_db_binary_value as array in...
Max filename length is set to 120 characters.  If you need more, you can change the width of the filename column in the xtattachments table.
MyBB sets the filename length to 120 characters in its attachments table, but I suppose there's no reason to follow that - I'll probably increase it to 255 characters.

Thanks for reporting.

My Blog
08-22-2014 04:56 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: