• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Error after server move in the admin panel: get_class() expects parameter 1
PostPosted: Thu Aug 27, 2009 11:41 am 
Offline
Forum Members
Forum Members

Joined: Wed Aug 26, 2009 6:25 am
Posts: 50
I am getting the following error after server move:

Code:
Warning: get_class() expects parameter 1 to be object, string given in C:\xampp\htdocs\admin\editcontent.php on line 165

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\admin\editcontent.php:165) in C:\xampp\htdocs\lib\classes\class.admintheme.inc.php on line 171

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\admin\editcontent.php:165) in C:\xampp\htdocs\lib\classes\class.admintheme.inc.php on line 174

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\admin\editcontent.php:165) in C:\xampp\htdocs\lib\classes\class.admintheme.inc.php on line 177

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\admin\editcontent.php:165) in C:\xampp\htdocs\lib\classes\class.admintheme.inc.php on line 178

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\admin\editcontent.php:165) in C:\xampp\htdocs\lib\classes\class.admintheme.inc.php on line 181

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\admin\editcontent.php:165) in C:\xampp\htdocs\lib\classes\class.admintheme.inc.php on line 186


This happens when editing a page in the admin panel.

What could be wrong?


Top
 Profile  
 
 Post subject: Re: Error after server move in the admin panel: get_class() expects parameter 1
PostPosted: Fri Aug 28, 2009 5:54 am 
Offline
Forum Members
Forum Members

Joined: Wed Aug 26, 2009 6:25 am
Posts: 50
Googled around a bit and it seems this error occurs with the PHP version 5.3.0.

For example:
http://euk1.php.net/bugs/bug.php?id=16431
http://bugs.php.net/bug.php?id=47664

Thie line producing the error:
Code:
else if ($content_id != -1 && strtolower(get_class($contentobj)) != strtolower($content_type))


Last edited by Hypocrite on Fri Aug 28, 2009 6:00 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Error after server move in the admin panel: get_class() expects parameter 1
PostPosted: Fri Aug 28, 2009 6:23 am 
Offline
Administrator
Administrator
User avatar

Joined: Thu Mar 09, 2006 5:32 am
Posts: 10209
Location: Arizona
I don't believe we support 5.3 yet...

http://www.cmsmadesimple.org/about-link/

_________________
Extensions » Modules/Tags click the name of the module/tag or Help to the right to get the parameters it takes
Right click and view source is a great way to see what you have to work with
Check ver. CMSMS, PHP, server OS, in System Information page
Default content, read it here, http://multiintech.com/defaultcontent/
People are Wonderful Business is Great Life is Terrific
Image


Top
 Profile  
 
 Post subject: Re: Error after server move in the admin panel: get_class() expects parameter 1
PostPosted: Tue Sep 22, 2009 1:00 pm 
Offline
New Member

Joined: Tue Sep 22, 2009 12:56 pm
Posts: 1
I was able to 'patch' this myself by doing the following:

open up /admin/editcontent.php

search and replace all get_class(
replace with fix_get_class(

add the code below to the top of the editcontent.php file

Code:
function fix_get_class($object)
{
   if (is_object($object)) {
      return strtolower(get_class($object));
   }
   return false;
}


Keep in mind this is a quick, rough patch. It seems to work just fine for me after the patch, and I have not run into any issues... yet.


Top
 Profile  
 
 Post subject: Re: Error after server move in the admin panel: get_class() expects parameter 1
PostPosted: Mon Oct 26, 2009 7:30 pm 
Offline
Administrator
Administrator
User avatar

Joined: Thu Mar 09, 2006 5:32 am
Posts: 10209
Location: Arizona
And hacking core files means we don't support you any more, cmsms doesn't work with 5.3 at this time...

_________________
Extensions » Modules/Tags click the name of the module/tag or Help to the right to get the parameters it takes
Right click and view source is a great way to see what you have to work with
Check ver. CMSMS, PHP, server OS, in System Information page
Default content, read it here, http://multiintech.com/defaultcontent/
People are Wonderful Business is Great Life is Terrific
Image


Top
 Profile  
 
 Post subject: Re: Error after server move in the admin panel: get_class() expects parameter 1
PostPosted: Fri Nov 13, 2009 7:05 pm 
Offline
New Member

Joined: Fri Nov 13, 2009 5:47 pm
Posts: 2
    You might be the administrator but here few thoughts.


    • * It's poor design not to check what your are trying to validate why trying to valide an object if it's not an object ?? What are the other like that under the hood

    • * There is no note in the download page that tell its not support under php5.3 - techspecs would be nice. Yes its in the FAQ page but who read the FAQ unless you run into a problem or you have a question?
    • * In that same FAQ you suggest to download XAMP by default the only download for windows come with PHP 5.3
    • last thing i don't consider modifying 2 line of code a change in the core. In no case the logic is change its just doing what you should have done in first place.

if any one get the same problem just add @ in front of get_class on line 97 and 165 this prevent php to throw a notice. and it dosen,t change the behavior of the function

Thanks

Dr. CSS wrote:
And hacking core files means we don't support you any more, cmsms doesn't work with 5.3 at this time...


Last edited by woyrz on Fri Nov 13, 2009 9:04 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Error after server move in the admin panel: get_class() expects parameter 1
PostPosted: Mon Nov 30, 2009 10:00 pm 
Offline
New Member

Joined: Thu Apr 27, 2006 3:42 pm
Posts: 6
I would stay away from this patch.  While I applaud the effort, there is a bug with the patch that does not allow the use of multiple content blocks.
I have engineered a "patch for the patch" since we were able to use a version of PHP compatible with CMSMS


Top
 Profile  
 
 Post subject: Re: Error after server move in the admin panel: get_class() expects parameter 1
PostPosted: Tue Sep 07, 2010 5:07 pm 
Offline
New Member

Joined: Fri May 01, 2009 6:10 am
Posts: 4
Read this http://blog.biernacki.ca/2009/09/cmsmad ... patch-fix/
It saves my time. Just for your eyes -> I use CMS Made Simple 1.4.1 "Spring Garden".


Top
 Profile  
 
 Post subject: Re: Error after server move in the admin panel: get_class() expects parameter 1
PostPosted: Tue Sep 07, 2010 5:09 pm 
Offline
Support Guru
Support Guru
User avatar

Joined: Mon Jul 04, 2005 5:12 pm
Posts: 4827
Location: Ferrara, Italy
fais1234 wrote:
Read this http://blog.biernacki.ca/2009/09/cmsmad ... patch-fix/
It saves my time. Just for your eyes -> I use CMS Made Simple 1.4.1 "Spring Garden".


and why you don't upgrade to 1.8.2?

Alby

_________________
CMSMS Support Team
Italian Admin and Moderator

Plugins: Geolocate hostip, Multiple random image, Image rotator (beta), Content Pagination
Modules: ForumMadeSimple (Howto), TranslationManager
Multilingual: MLE is not CMSMS


Top
 Profile  
 
 Post subject: Re: Error after server move in the admin panel: get_class() expects parameter 1
PostPosted: Tue Sep 07, 2010 6:03 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Fri Dec 28, 2007 12:33 am
Posts: 93
I've tried and tried and the upgrade keeps crashing after step 1. (http://forum.cmsmadesimple.org/index.ph ... #msg223292)  I'm going to try this fix as a stop gap until I can catch my breath and figure this thing out. 


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Arvixe - A CMSMS Partner