Need help for php error in 3rd party plugin Topic is solved

This forum is for general questions about extensions for Joomla! version 1.5.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Post Reply
syco
Joomla! Intern
Joomla! Intern
Posts: 51
Joined: Thu May 22, 2008 2:00 pm
Location: Singleton, Australia

Need help for php error in 3rd party plugin

Post by syco » Fri Jul 10, 2020 1:30 am

Hi Guys,

I recently had a very old site that was hacked... and yes I know it's a Joomla 1.5, but the guy doesn't want to spend money updating to the latest versions and is happy with the site.

I loaded the back-up version of the site on my localhost MAMP ... and the site worked perfectly - not showing any php errors.

I then went to the cloud hosting server - deleted everything in the root directory to remove the hacks , and then reinstalled the same back-up site - onto the cloud hosting. Everything works fine with the operation of the site, but on one of the pages I get the following error with a 3rd party plugin (rokstories - from rockettheme)

Here's the error:

Code: Select all

Warning: Creating default object from empty value in /home/content/04/5370604/html/peterklasen/modules/mod_rokstories/helper.php on line 237
Here's the URL to the page:
http://www.peterklasenhomes.com.au/our-process

I have gone into the Global Config and tried setting the Error Reporting in Servers Setting - to NONE and System Default, but this has no effect and the errors still remain.

I spoke with Godaddy the hosting provider, to see if they could help e.g. with a php.ini file edit, or changes to the .htaccess file, but they couldn't help either.

With this being an old 3rd party module, I no longer have login support with Rockettheme's who built the rok_stories_mod that has the issue with php.

I'm not a coder, so I have hit a wall on how to get the site to NOT display the - php errors for this 3rd party plugin.

Any guidance or help would be much appreciated !!!

Regards,

Syco
Last edited by toivo on Fri Jul 10, 2020 1:34 am, edited 1 time in total.
Reason: mod note: moved from 1.5 General Questions

 
User avatar
sozzled
Joomla! Exemplar
Joomla! Exemplar
Posts: 9590
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Need help for php error in 3rd party plugin

Post by sozzled » Fri Jul 10, 2020 1:49 am

syco wrote:
Fri Jul 10, 2020 1:30 am
I recently had a very old site that was hacked... and yes I know it's a Joomla 1.5, but the guy doesn't want to spend money updating to the latest versions and is happy with the site.
Fair enough. If that's the decision someone makes then that's the choice they have to live with.

syco wrote:
Fri Jul 10, 2020 1:30 am
I spoke with Godaddy the hosting provider, to see if they could help ...
It's not the webhost's problem if they can't provide a hosting environment for technology that's unsupported, outdated, vulnerable or outside their capability. That's the owner's responsibility. If "the guy" is happy with their website but doesn't like their current web hosting provider then find another web hosting provider. Good luck with that.

Rockettheme retired those plugins years ago so I wouldn't expect help from them.

syco wrote:
Fri Jul 10, 2020 1:30 am
... how to get the site to NOT display the - php errors for this 3rd party plugin.
If you can get the website to work on your MAMP server, and "the guy" is not interested in updating their website or fixing these problems properly, then I don't know what else to suggest. It's not our problem; it's not even your problem. It's "the guy's" problem. Talk to "the guy" and ask him what he's prepared to do.

Perhaps you can create your own service, host "the guy's" website for him, accept the responsibility for ensuring that your business is not compromised because your server allows this website—that has already been hacked before and probably will be hacked again—to ruin your reputation. Good luck.

I will say this: I would not offer my services to you (or "the guy") to find a quick fix because—let's assume I could do that—if something went wrong then it would be my responsibility and my reputation that would suffer as a result.

The website in question has the by-line "building homes with excellence", but the website uses second-rate building materials. It doesn't say a lot about the business, does it? I see that you're located in Australia. If you would like to contact me by email, we could arrange a teleconference (at no cost to you) to discuss your options. I'll leave that in your hands if you want guidance on how to go from here. Cheers. :)
https://www.kuneze.com/blog
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?” :)

syco
Joomla! Intern
Joomla! Intern
Posts: 51
Joined: Thu May 22, 2008 2:00 pm
Location: Singleton, Australia

Re: Need help for php error in 3rd party plugin

Post by syco » Fri Jul 10, 2020 2:35 am

Hi Sozzled,

Thanks for the quick reply.

Sorry if you misunderstood my intent, as I wasn't expecting anyone to put their reputation on the line for this type of error, or requesting to fix it for me.

Was just hoping there maybe a thread or some info on how to hide 3rd party plugin errors. I'm not implying this is a Joomla issue either, I just thought there might be someone in the Joomla community that could offer a suggestion, as I fully understand the whole set up is fully past it's life time... by years.

You said,
The website in question has the by-line "building homes with excellence", but the website uses second-rate building materials. It doesn't say a lot about the business, does it?
which I feel is a little bit harsh. His business is just in a very small country town and his quality of workmanship is excellent, but the turnover in a small town financially is very low compared to major cities. I was just try to help with his issue.

Cheers,

Syco
Last edited by syco on Fri Jul 10, 2020 2:37 am, edited 1 time in total.

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 12731
Joined: Thu Feb 15, 2007 5:48 am
Location: Zagreb, Croatia

Re: Need help for php error in 3rd party plugin

Post by toivo » Fri Jul 10, 2020 2:36 am

Was the backup file backed up before the website was hacked? There is no guarantee that the actual vulnerability has been removed by installing the backup file into a clean directory. The website can still get exploited, unless it was hacked from a compromised server and the site now hosted in a more secure server.

The Joomla 1.5 versions of the RocketTheme extensions can still be downloaded from RokLegacy Extensions Files, including version 2.2 of the RokStories module. However, the version installed at the website must be older because the warning shows 237 as the line number and that line in the file helper.php of version 2.2 cannot generate any warnings:

Code: Select all

        $i=0;
Locate line 237 in the file modules/mod_rokstories/helper.php and insert the following line above it to get rid of PHP warnings and other messages:

Code: Select all

        error_reporting(0);
Please note that vulnerabilities in outdated extensions do not disappear. They are still there for script kids and hackers to exploit. The best cause of action is to audit the website and migrate it to a supported version of Joomla.

BTW, Singleton is a beautiful town in the Hunter, been there a few times.
Toivo Talikka, Global Moderator

User avatar
sozzled
Joomla! Exemplar
Joomla! Exemplar
Posts: 9590
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Need help for php error in 3rd party plugin

Post by sozzled » Fri Jul 10, 2020 2:50 am

@syco: I didn't intend to be critical for the fun of it; I meant for my response to illustrate the difficulties one faces when one takes decisions. Regardless of what decision one takes, one has to live with the consequences of that decision; there's no easy way out of that.

Thanks, @toivo, for providing us with the location for some of Rockettheme's retired software. @toivo's advice sounds reasonable.

My offer to discuss things over a cup of coffee (via teleconference) still stands. Regardless of the economic situation with the website owner, if people see a broken website then people will form their own conclusion about the state of the site owner's business and the business' reputation. But, to be candid, the cost of re-doing the website should not be prohibitive. If the website owner feels that the cost of doing business (which, these days, requires an online presence to attract customers) is too heavy a financial burden then there are always alternatives.

I can only speak from experience. When I consider the number of J! 1.5 websites that I've been involved with (as a site owner or as a consultant) and horror stories that I could tell, it's little wonder that J! 1.5 is not a good strategy to use if one wants to base one's business on it. 8)
https://www.kuneze.com/blog
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?” :)

syco
Joomla! Intern
Joomla! Intern
Posts: 51
Joined: Thu May 22, 2008 2:00 pm
Location: Singleton, Australia

Re: Need help for php error in 3rd party plugin

Post by syco » Fri Jul 10, 2020 2:51 am

Hi Toivo,

Thank you so much for the reply and suggestions.

You said
Was the backup file backed up before the website was hacked?
No, the back up is from my original localhost environment which is not connected externally to the net.

I have tried removing the the 1.6 version is uses and reinstalling the 2.2 Rokstories, but the module totally stopped working once I did that for some reason.

I also just inserted what you suggested: $i=0; , but it deosn't seem to have worked.

What I might try is removing and reinstalling the rok_stories mod on my localhost, get it running there with the latest version, then try re uploading it again.

Also I have also been to the configuration.php file and changed the error_reporting(0); to zero.

Are you suggesting I add the same code line in the helper.php file?

Yes Singleton is lovely especially in the wine region... but these coal mining industries loving smashing the land up. :)

Thanks again for your suggestions !!!

I'll let you know how I go.

Cheers,

Syco

User avatar
sozzled
Joomla! Exemplar
Joomla! Exemplar
Posts: 9590
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Need help for php error in 3rd party plugin

Post by sozzled » Fri Jul 10, 2020 3:05 am

@syco: no, @toivo did not suggest that you insert a line with

Code: Select all

   $i=0;
in it. He wrote that you should locate line 237 in whatever version you had installed and, immediately before that line (whatever it was), to insert a line that basically says turn off any errors/warnings that may occur after this, unless the error is a fatal). That's called "sweeping the problem under the carpet".

It will remove displaying the warning but that's all it will do. It will not make the instance (or possibly 10 instances) of installed module function as they're supposed to function.
Last edited by sozzled on Fri Jul 10, 2020 3:19 am, edited 1 time in total.
https://www.kuneze.com/blog
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?” :)

syco
Joomla! Intern
Joomla! Intern
Posts: 51
Joined: Thu May 22, 2008 2:00 pm
Location: Singleton, Australia

Re: Need help for php error in 3rd party plugin

Post by syco » Fri Jul 10, 2020 3:12 am

Hi Sozzled,

Yes I understand your points (and agree), and as I said he doesn't want to spend money fixing old systems. I have been asking him to update his site for the past 6 years informing him of all the security and short comings of J1.5. He is coming around and trying to get some new images to build a new site soon, but I was just trying to help him out in the mean time... as he does take ages to provide the things I require to build a fresh site.

Cheers,

Syco

syco
Joomla! Intern
Joomla! Intern
Posts: 51
Joined: Thu May 22, 2008 2:00 pm
Location: Singleton, Australia

Re: Need help for php error in 3rd party plugin

Post by syco » Fri Jul 10, 2020 3:16 am

I tried adding it on line 237, then hit the enter key so it pushed the 237 to 238.. (if that makes sense) but it broke the site.

Follow is line 229 to 255, and please note there is already that code on the 229 line:

Code: Select all

        $i=0;
		$lists	= array();
		
		if (is_array($rows) && count($rows)>0) {
    		foreach ( $rows as $row )
    		{
    		    //process content plugins
    		    $text = JHTML::_('content.prepare',$row->introtext,$cparams);
    			$lists[$i]->id = $row->id;
    			$lists[$i]->created = $row->created;
    			$lists[$i]->modified = $row->modified;
    			$lists[$i]->title = htmlspecialchars( $row->title );
    			$lists[$i]->introtext = modRokStoriesHelper::prepareContent($text, $params);

    			if ($content_type=='joomla') {
    			    $lists[$i]->link = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug, $row->sectionid));
    			    $images = modRokStoriesHelper::getImages($row->introtext,$thumb_size);
    			} else {
    			    $lists[$i]->link = JRoute::_(K2HelperRoute::getItemRoute($row->id.':'.$row->alias, $row->catid.':'.$row->categoryalias));
    			    $images = modRokStoriesHelper::getK2Images($row->id,$image_size,$thumb_size);
    			}
			
    			$lists[$i]->image = $images->image;
    			$lists[$i]->thumb = $images->thumb;
    			$i++;
    		}
        }
Following is the actual 237 line:

Code: Select all

$lists[$i]->id = $row->id;
I am happy to sweep this under the carpet as you mentioned... not looking for a total fix... so if this hides the issue that's perfect, as it's only trying to fix this in the interim, until a new site it built.

Just not fully clear on where I place his suggestion... in that line of code... as placing just before 237 didn't seem to work.

Thanks again.

User avatar
sozzled
Joomla! Exemplar
Joomla! Exemplar
Posts: 9590
Joined: Sun Jul 05, 2009 3:30 am
Location: Canberra, Australia

Re: Need help for php error in 3rd party plugin

Post by sozzled » Fri Jul 10, 2020 3:23 am

OK, you b****red it up. Remove whatever you added. If the original line 237 was

Code: Select all

$lists[$i]->id = $row->id;
then leave that line alone, too. Insert one line immediately before the original line 237 with

Code: Select all

        error_reporting(0);
Try that. If that fails then I can't help via the forum, sorry.
https://www.kuneze.com/blog
“If you think I’m wrong then say, ‘I think you’re wrong.’ If you say ‘You’re wrong!’, how do you know?” :)

syco
Joomla! Intern
Joomla! Intern
Posts: 51
Joined: Thu May 22, 2008 2:00 pm
Location: Singleton, Australia

Re: Need help for php error in 3rd party plugin

Post by syco » Fri Jul 10, 2020 3:28 am

When I add

Code: Select all

error_reporting(0);
... just before the original line 237... I get the following error.
Fatal error: Class 'modRokStoriesHelper' not found in /home/content/04/5370604/html/peterklasen/modules/mod_rokstories/mod_rokstories.php on line 20
I have removed and changed everything back to what it was.

Thanks for your help btw.

syco
Joomla! Intern
Joomla! Intern
Posts: 51
Joined: Thu May 22, 2008 2:00 pm
Location: Singleton, Australia

Re: Need help for php error in 3rd party plugin

Post by syco » Fri Jul 10, 2020 3:33 am

I think I might try, as I suggested in updating my localhost version to 2.2 rok stories_mod, then see if this works fine on my localhost... If it does... then I'll try uploading it to the LIVE site and see what happens, at least that way I know I have the latest version running then.

syco
Joomla! Intern
Joomla! Intern
Posts: 51
Joined: Thu May 22, 2008 2:00 pm
Location: Singleton, Australia

Re: Need help for php error in 3rd party plugin

Post by syco » Fri Jul 10, 2020 5:59 am

Yay !!! :) :) :) :)

Thanks Toivo !!!

I updated my localhost site just as a test to be using the latest versions of rok_stories 2.2 , and my local server still shows NO php errors, at all.

I then update the LIVE site as well to be: rok_stories 2.2 (latest version) but the php error still remained, but has just changed to a different line number. (from 237 to line 245 now)
Warning: Creating default object from empty value in /home/content/04/5370604/html/peterklasen/modules/mod_rokstories/helper.php on line 245
I then inserted the:

Code: Select all

error_reporting(0);

directly above the line 245... and it fixed the issue. :D

I can't thank you enough mate... and if you ever get back to Singleton some time... I'll shout you a few beers (or a wine or 2) :)

Also thank you also Sozzled for your assistance.

Now I'm of to tighten the screws on this builder to move to Joomla 3 or soon 4.

Cheers guys !!! Have a great weekend.

Syco

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 12731
Joined: Thu Feb 15, 2007 5:48 am
Location: Zagreb, Croatia

Re: Need help for php error in 3rd party plugin

Post by toivo » Fri Jul 10, 2020 6:56 am

Glad that it worked out! The live site must have a later version of PHP than the localhost and it is therefore dishing out more PHP warnings.

Thanks for the offer, I will keep it in mind! Good luck with your client, too.

After the current Beta testing and the subsequent Release Candidate phases are completed, there will be an upgrade path from 3.9 through 3.10 to version 4.0. At that stage, no doubt, the Joomla Extensions Directory (JED) will have a few Joomla 4 compatible templates and media extensions to choose from. Already now it is possible to search for them and test them on localhost.
Toivo Talikka, Global Moderator

syco
Joomla! Intern
Joomla! Intern
Posts: 51
Joined: Thu May 22, 2008 2:00 pm
Location: Singleton, Australia

Re: Need help for php error in 3rd party plugin

Post by syco » Sat Jul 11, 2020 12:50 am

Yes, I'm keeping my eye on J4.

Thanks again !

 

Post Reply

Return to “Extensions for Joomla! 1.5”