Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8742643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:32:11+00:00 2026-06-13T11:32:11+00:00

I have searched a lot for this issue. But couldn’t find the exact answer.

  • 0

I have searched a lot for this issue. But couldn’t find the exact answer. I am getting this error Warning: Creating default object from empty value in mod_random_image/helper.php on line 85. My code is given below:

 58         function getImages(&$params, $folder)
 59         {
 60                 $type           = $params->get( 'type', 'jpg' );
 61 
 62                 $files  = array();
 63                 $images = array();
 64 
 65                 $dir = JPATH_BASE.DS.$folder;
 66 
 67                 // check if directory exists
 68                 if (is_dir($dir))
 69                 {
 70                         if ($handle = opendir($dir)) {
 71                                 while (false !== ($file = readdir($handle))) {
 72                                         if ($file != '.' && $file != '..' && $file != 'CVS' && $file != 'index.html' ) {
 73                                                 $files[] = $file;
 74                                         }
 75                                 }
 76                         }
 77                         closedir($handle);
 78 
 79                         $i = 0;
 80                         foreach ($files as $img)
 81                         {
 82                                 if (!is_dir($dir .DS. $img))
 83                                 {
 84                                         if (preg_match("#$type#i", $img)) {
 85                                                 $images[$i]->name       = $img;
 86                                                 $images[$i]->folder     = $folder;
 87                                                 ++$i;
 88                                         }
 89                                 }
 90                         }
 91                 }
 92 
 93                 return $images;
 94         }

This error is getting after I upgraded PHP version to 5.4.8. I have looked into the joomla configuration file also. I set the var $error_reporting = ‘-1’; in the joomla configuration. But I am still getting the same error. I haven’t used Joomla before.

Any help will be appreciated.
Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:32:11+00:00Added an answer on June 13, 2026 at 11:32 am

    The error occurs because $images[$i] has not been defined yet as an object and PHP instantiated a default object (of type stdClass) implicitely. To solve this problem just add this line before line 85:

    $images[$i] = new stdClass();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have searched a lot and tried much but I can not find the
I have searched for a general solution to this but only find answers to
I have searched a lot of places but couldnt find a clean sequential explanation
I've searched around on a lot of forums but have yet to find an
i have searched a lot. I'm facing this error Create method in Controller is
all I have searched this in google, but I confused with lot of sites
I have searched this site extensively but cannot find a solution. Here is the
I have searched a lot and couldn't found the approach to create the small
I have searched a lot trying to find something for my purpose, however most
I have searched a lot about the difference between Website and WebApplication but didn't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.