Page 1 of 1
[Solved]Need advice on how to replace some smarty tags
Posted: Wed Oct 26, 2011 3:59 am
by jasnick
Upgraded to 1.10. In Admin:
Warning: Invalid argument supplied for foreach() in /home/...../public_html/admin/header.php on line 70
foreach( $gCms->modules as $modulename => $ext )
In upgrade instructions:
3: Removed the $gCms→modules array. use cms_utils::get_module() instead.
How exactly does this get replaced? I tried a Find and Replace using $gCms->modules and cms_utils::get_module exactly as written but it said string not found. Do these need to be enclosed in any way? So then I used the whole line making it
foreach( cms_utils::get_module() as $modulename =>$ext )
This lead to another error coming up in class.cms_utils.php
final public static function & get_module($name,$version = '')
{
return cmsms()->GetModuleInstance($name,$version);
}
Where does it end? What do I do here? Not so easy to upgrade if one doesn't know php.
I have also to do some changes to the footer menu along the same lines but will wait until I know the correct way to do this.
Thanks
Re: Need advice on how to replace some smarty tags
Posted: Wed Oct 26, 2011 5:21 pm
by Dr.CSS
That is most likely an error from a module, if you aren't using a custom admin theme, check that all your modules are up to date...
Re: Need advice on how to replace some smarty tags
Posted: Wed Oct 26, 2011 5:33 pm
by calguy1000
line 70 if admin/header.php is:
Code: Select all
debug_buffer('before notifications');
Which tells me you had a problem with uploading files. Because that is from an earlier version (not gonna bother to find which).
Re-upload your files, re-run the upgrade routine AND do a system verification.
Re: Need advice on how to replace some smarty tags
Posted: Wed Oct 26, 2011 11:53 pm
by jasnick
Yes, Dr.CSS - it is the Modules that are giving me the problems.
Calguy - Yes, I did originally stuff up the upgrade by not upgrading individual modules first - THAT will never happen again! I reverted to the previous installation 1.9.4.3 but somehow the Module Manager was never the same again! I restored some stuff via cpanel but it is not right yet.
Will start completely over and follow your instructions above. My fault for not doing it correctly in the first instance.
Thanks for the help.
Re: Need advice on how to replace some smarty tags
Posted: Thu Oct 27, 2011 7:08 am
by jasnick
I've restored my problem site to 1.9.4.3 and restored the general backup so things are back to normal. Will proceed very slowly.
Thanks!
Re: Need advice on how to replace some smarty tags
Posted: Thu Oct 27, 2011 9:09 pm
by carasmo
I would duplicate the site and only upgrade the duplicated site. With cpanel, which I insist upon not being a programmer, I back up the database with the backup wizard, create a new database, open up phpmyadmin, uload up the old database into the new database, change the config file in the copied site (located in a subdomain, so I dont' need to deal with .htaccess). Then I have a complete copy of the site. The original is untouched. The database is copied and all the files are copied, this takes about 5 min or less with cpanel, filemanager, phpmyadmin. Then I upgrade the copy. Done this for years, my hair is less gray. Once that is smoothed out, then I still keep a copy of the old site in another subdomain with the old database, and move the main one to the root, and change the config.php to work from the root.
Re: Need advice on how to replace some smarty tags
Posted: Thu Oct 27, 2011 10:43 pm
by jasnick
Thanks carasmo, that seems a good way to go! I'm not a programmer either so have to rely on everything working as it should!
Re: Need advice on how to replace some smarty tags
Posted: Thu Oct 27, 2011 10:59 pm
by carasmo
Then immediately when you go to the copied site, change the sitename to the COPY with something that will get your attention, that way you don't mess up and start pasting in new code and fixes into the pristine old backup. I did this yesterday, fortunately, each template I make I make a text file of it and then I had it.
Re: Need advice on how to replace some smarty tags
Posted: Thu Oct 27, 2011 11:08 pm
by jasnick
Yes! - I have to really think what I am doing all the time.