Catchable fatal error:

  • MaryJane
  • Newbie
  • Newbie
  • MaryJane
  • Posts: 5

Post 3+ Months Ago

Hello!

I found a solution on your forum, it says to make a new topic with the complete error and the code around the line in the error.

I hope somebody can help me.


Catchable fatal error: Object of class stdClass could not be converted to string in /var/www/***/***/HTML/administrator/components/com_lovefactory/helper.php on line 926

Code: [ Select ]
function showFieldInEditProfile($field, $default, $page = 2)
 {
  if (!$field->published)
  {
   return false;
  }

  $output = '';

  if ($default !== false)
  {
   if ($field->type_id == 10)
   {
    $default = $default->sex;
   }
   elseif ($field->type_id == 11)
   {
    $default = $default->looking;
   }
   else
   {
    $default = $default->{'field_' . $field->id};
   }
  }

  $output .= self::fieldRequiredMessage($field);
  $output .= '<tr>';
  $output .= ' <td>' . self::showLabel($field, $page) . '</td>';
  $output .= ' <td>' . self::showDescription($field) . '</td>';

  if ($default === false)
  {
   $output .= ' <td>' . self::convertFieldToEdit($field, $page);
  }
  else
  {
   $output .= ' <td>' . self::convertFieldToEdit($field, $page, array('defaults' => array('values' => $default)));
  }
  $output .= ' </td>';
  $output .= '</tr>';

  return $output;
 }

 function showFieldInViewProfile($field, $defaults, &$visibility = array())
 {
  if (!$field->published)
  {
   return false;
  }

  if (isset($visibility[$defaults->user_id][$field->id]) && $visibility[$defaults->user_id][$field->id] == 0)
  {
   return false;
  }

  $output = '';

  if ($field == null)
  {
   return $output;
  }

  if (!$field->system)
  {
   if ($field->type_id == 10)
   {
    $defaults = $defaults->sex;
   }
   elseif ($field->type_id == 11)
   {
    $defaults = $defaults->looking;
   }
   else
   {
    $defaults = $defaults->{'field_' . $field->id};
   }

   #var_dump($defaults);
   #$defaults = $defaults->{'field_' . $field->id};
  }

  $output .= '<tr>';

  if (!in_array($field->type_id, array(9)))
  {
   $output .= ' <td style="padding-right: 10px;">' . self::showLabel($field, 6) . '</td>';
   $colspan = 1;
  }
  else
  {
   $colspan = 2;
  }

  $output .= ' <td colspan="' .$colspan . ' ">' . self::convertFieldToShow($field, $defaults);
  $output .= ' </td>';
  $output .= '</tr>';

  return $output;
 }

 function showFieldInSearch($field)
 {
  if (!$field->published)
  {
   return false;
  }

  $field->required = false;

  $output = '';

  $output .= self::fieldRequiredMessage($field);
  $output .= '<tr>';
  $output .= ' <td>' . self::showLabel($field, 3) . '</td>';
  $output .= ' <td>' . self::convertFieldToEdit($field, 3, array('defaults' => array()));
  $output .= ' </td>';
  $output .= '</tr>';

  return $output;
 }

 function createUpdateQuery($field)
 {
  switch ($field->type_id)
  {
  1. function showFieldInEditProfile($field, $default, $page = 2)
  2.  {
  3.   if (!$field->published)
  4.   {
  5.    return false;
  6.   }
  7.   $output = '';
  8.   if ($default !== false)
  9.   {
  10.    if ($field->type_id == 10)
  11.    {
  12.     $default = $default->sex;
  13.    }
  14.    elseif ($field->type_id == 11)
  15.    {
  16.     $default = $default->looking;
  17.    }
  18.    else
  19.    {
  20.     $default = $default->{'field_' . $field->id};
  21.    }
  22.   }
  23.   $output .= self::fieldRequiredMessage($field);
  24.   $output .= '<tr>';
  25.   $output .= ' <td>' . self::showLabel($field, $page) . '</td>';
  26.   $output .= ' <td>' . self::showDescription($field) . '</td>';
  27.   if ($default === false)
  28.   {
  29.    $output .= ' <td>' . self::convertFieldToEdit($field, $page);
  30.   }
  31.   else
  32.   {
  33.    $output .= ' <td>' . self::convertFieldToEdit($field, $page, array('defaults' => array('values' => $default)));
  34.   }
  35.   $output .= ' </td>';
  36.   $output .= '</tr>';
  37.   return $output;
  38.  }
  39.  function showFieldInViewProfile($field, $defaults, &$visibility = array())
  40.  {
  41.   if (!$field->published)
  42.   {
  43.    return false;
  44.   }
  45.   if (isset($visibility[$defaults->user_id][$field->id]) && $visibility[$defaults->user_id][$field->id] == 0)
  46.   {
  47.    return false;
  48.   }
  49.   $output = '';
  50.   if ($field == null)
  51.   {
  52.    return $output;
  53.   }
  54.   if (!$field->system)
  55.   {
  56.    if ($field->type_id == 10)
  57.    {
  58.     $defaults = $defaults->sex;
  59.    }
  60.    elseif ($field->type_id == 11)
  61.    {
  62.     $defaults = $defaults->looking;
  63.    }
  64.    else
  65.    {
  66.     $defaults = $defaults->{'field_' . $field->id};
  67.    }
  68.    #var_dump($defaults);
  69.    #$defaults = $defaults->{'field_' . $field->id};
  70.   }
  71.   $output .= '<tr>';
  72.   if (!in_array($field->type_id, array(9)))
  73.   {
  74.    $output .= ' <td style="padding-right: 10px;">' . self::showLabel($field, 6) . '</td>';
  75.    $colspan = 1;
  76.   }
  77.   else
  78.   {
  79.    $colspan = 2;
  80.   }
  81.   $output .= ' <td colspan="' .$colspan . ' ">' . self::convertFieldToShow($field, $defaults);
  82.   $output .= ' </td>';
  83.   $output .= '</tr>';
  84.   return $output;
  85.  }
  86.  function showFieldInSearch($field)
  87.  {
  88.   if (!$field->published)
  89.   {
  90.    return false;
  91.   }
  92.   $field->required = false;
  93.   $output = '';
  94.   $output .= self::fieldRequiredMessage($field);
  95.   $output .= '<tr>';
  96.   $output .= ' <td>' . self::showLabel($field, 3) . '</td>';
  97.   $output .= ' <td>' . self::convertFieldToEdit($field, 3, array('defaults' => array()));
  98.   $output .= ' </td>';
  99.   $output .= '</tr>';
  100.   return $output;
  101.  }
  102.  function createUpdateQuery($field)
  103.  {
  104.   switch ($field->type_id)
  105.   {
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • MaryJane
  • Newbie
  • Newbie
  • MaryJane
  • Posts: 5

Post 3+ Months Ago

The error line was the following

$output .= ' <td colspan="' .$colspan . ' ">' . self::convertFieldToShow($field, $defaults);

I changed it into

$output .= ' <td colspan="' .$colspan . ' ">' . self::convertFieldToShow($field->field, $defaults->defaults);

The error is gone, but the fields are empty, somebody got any idea what i can do?
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

How did you get into this situation ?
  • MaryJane
  • Newbie
  • Newbie
  • MaryJane
  • Posts: 5

Post 3+ Months Ago

joebert wrote:
How did you get into this situation ?



I did an upgrade of lovefactory, a joomla extension, then i got the error. In lovefactory before the upgrade users had problems editing there profile.

thank you
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

You don't get support included with the purchase price of that extension ?
  • MaryJane
  • Newbie
  • Newbie
  • MaryJane
  • Posts: 5

Post 3+ Months Ago

joebert wrote:
You don't get support included with the purchase price of that extension ?



They gave the upgrade with comment that there can be errors, they advise to undo the backup, that's it untill the next version comes, they help, but not quite enough to get me going.
Also they are only availble certain hours, wich makes me search the internet untill i get an answer.

I find it to simple to just do the backup and not try to solve it.

Do you maybe have any idea?
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

I'd listen to the support people if I were you. There's always the chance that fixing something yourself could complicate any update they give you down the road. :)

The error you're getting is definitely programmer error. When a function tries to convert an instance of stdClass to a string like that, it means that the programmer let an object slip through a conversion process somewhere.
  • MaryJane
  • Newbie
  • Newbie
  • MaryJane
  • Posts: 5

Post 3+ Months Ago

Thank you!

I will be a good girl and listen to the people that know what they are on about!

Post Information

  • Total Posts in this topic: 8 posts
  • Users browsing this forum: No registered users and 146 guests
  • 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.