Topic-icon Error message after Joomla 3.4 upgrade

Active Subscriptions:

None
9 years 1 month ago - 9 years 1 month ago #51589 by rebelofoz
Since upgrading Joomla 3.36 to version 3.4 I am getting the following error message on the backend.
Strict Standards: Declaration of JFBConnectProfileDataProxy::bindData() should be compatible with Joomla\Registry\Registry::bindData($parent, $data, $recursive = true, $allowNull = true) in /home/rebelins/public_html/components/com_jfbconnect/libraries/profile.php on line 119

awesomescreenshot.com/0dc4ihkk8b

I've run autotune and that's what I got:

awesomescreenshot.com/00d4ihkvf5

I checked all JFBConnect related plugins and they are all enabled.

awesomescreenshot.com/0d34ihky0d

Upgrading Joomla to version 3.4 is the only change I made in the past couple of weeks.


UPDATE:

I've meanwhile been able to get rid of the error message in the 'error check' tab of autotune by opening the languages used by my multilingual site, setting them all to public and saving them again. (For some reason, the default language, English, was not set to public like the other language, German.) However, above error message is still occuring, even though I set the php variable display_errors to NO.
Last edit: 9 years 1 month ago by rebelofoz.
The topic has been locked.
Support Specialist
9 years 1 month ago #51590 by mel
Please see the workaround in www.sourcecoast.com/forums/jfbconnect/jf...-to-joomla-34#p51478

The fix has already been checked in for our next JFBConnect release.

-Melissa
The topic has been locked.
Active Subscriptions:

None
9 years 1 month ago - 9 years 1 month ago #51592 by rebelofoz
Thank you for the prompt response, Melissa. Unfortunately, I'm now getting an additional error message. The first one hasn't gone away.
Strict Standards: Declaration of JFBConnectProfileDataProxy::bindData() should be compatible with Joomla\Registry\Registry::bindData($parent, $data, $recursive = true, $allowNull = true) in /home/rebelins/public_html/components/com_jfbconnect/libraries/profile.php on line 119

Warning: Cannot modify header information - headers already sent by (output started at /home/rebelins/public_html/components/com_jfbconnect/libraries/profile.php:119) in /home/rebelins/public_html/components/com_jfbconnect/libraries/provider/facebook.php on line 299

Here's the code of my changed profile.php file:
<?php
/**
 * @package         JFBConnect
 * @copyright (c)   2009-2014 by SourceCoast - All Rights Reserved
 * @license         http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 * @version         Release v6.2.4
 * @build-date      2014/12/15
 */

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');


jimport('sourcecoast.utilities');

class JFBConnectProfile
{
    var $provider;
    var $providerFields;

    public function __construct($provider)
    {
        $this->provider = $provider;
        $this->setProviderFields();
    }

    protected function setProviderFields()
    {
        $this->providerFields = null;
    }

    public function getPermissionsForFields($fields)
    {
        $perms = array();

        return $perms;
    }

    public function getProviderFields()
    {
        return $this->providerFields;
    }

    /**
     *  Get all permissions that are required by Facebook for email, status, and/or profile, regardless
     *    of whether they're set to required in JFBConnect
     * @return string Comma separated list of FB permissions that are required
     */
    static private $requiredScope;

    public function getRequiredScope()
    {
        return self::$requiredScope;
    }

    /*
     * Fetch a user's profile based on a profile plugin field-mapping
     * @return JRegistry with profile field values
     */
    public function fetchProfileFromFieldMap($fieldMap, $permissionGranted = true)
    {
        $fields = array();
        if (is_object($fieldMap))
        {
            foreach ($fieldMap as $field)
            {
                $fieldArray = explode('.', $field);
                if (!empty($fieldArray[0]))
                    $fields[] = $fieldArray[0]; // Get the root field to grab from FB
            }
        }
        $providerUserId = $this->provider->getProviderUserId();

        $fields = array_unique($fields);
        $profile = $this->fetchProfile($providerUserId, $fields);
        $profile->setFieldMap($fieldMap);
        return $profile;
    }

    /* Fetch a user's profile based on the passed in array of fields
    * @return JRegistry with profile field values
    */
    public function fetchProfile($providerUserId, $fields)
    {
        $profile = new JFBConnectProfileData();
        return $profile;
    }

    public function fetchStatus($providerUserId)
    {
        return "";
    }


    // Created for parity with JLinked/SourceCoast library
    // nullForDefault - If the avatar is the default image for the social network, return null instead
    // Prevents the default avatars from being imported
    function getAvatarUrl($fbUserId, $nullForDefault = true, $params = null)
    {
        return null;
    }

    function getProfileUrl($providerId)
    {
        return null;
    }

    function getCoverPhoto($providerId)
    {
        return null;
    }
}

// Declare a special JRegistry class with bindData specific to the J! version to prevent a strict standards
$jVersion = new JVersion();
if (version_compare($jVersion->getShortVersion(), '3.4.0', '>='))
{
    class JFBConnectProfileDataProxy extends JRegistry
    {
        /* bindData
         * Overridden function due to Joomla's checking of each variable to see if it's an associative array or not
         * We don't care, we want all arrays to be translated to a class
         */
        protected function bindData($parent, $data, $recursive = true)
        {
            // Ensure the input data is an array.
            if (is_object($data))
                $data = get_object_vars($data);
            else
                $data = (array)$data;

            foreach ($data as $k => $v)
            {
                if (is_array($v) || is_object($v))
                {
                    $parent->$k = new stdClass;
                    $this->bindData($parent->$k, $v);
                }
                else
                    $parent->$k = $v;
            }
        }
    }
}
else if (version_compare($jVersion->getShortVersion(), '3.3.0beta', '>='))
{
    class JFBConnectProfileDataProxy extends JRegistry
    {
        /* bindData
         * Overridden function due to Joomla's checking of each variable to see if it's an associative array or not
         * We don't care, we want all arrays to be translated to a class
         */
        protected function bindData($parent, $data)
        {
            // Ensure the input data is an array.
            if (is_object($data))
                $data = get_object_vars($data);
            else
                $data = (array)$data;

            foreach ($data as $k => $v)
            {
                if (is_array($v) || is_object($v))
                {
                    $parent->$k = new stdClass;
                    $this->bindData($parent->$k, $v);
                }
                else
                    $parent->$k = $v;
            }
        }
    }
}
else
{
    class JFBConnectProfileDataProxy extends JRegistry
    {
        protected function bindData(&$parent, $data)
        {
            // Ensure the input data is an array.
            if (is_object($data))
                $data = get_object_vars($data);
            else
                $data = (array)$data;

            foreach ($data as $k => $v)
            {
                if (is_array($v) || is_object($v))
                {
                    $parent->$k = new stdClass;
                    $this->bindData($parent->$k, $v);
                }
                else
                    $parent->$k = $v;
            }
        }
    }
}


class JFBConnectProfileData extends JFBConnectProfileDataProxy
{
    var $fieldMap;

    // All providers must support the retrieval of the following fields:
    // email, full_name, first_name, middle_name, last_name
    function get($path, $default = null)
    {
        if ($this->exists($path))
            return parent::get($path, $default);
        else
            return $default;
    }

    function setFieldMap($fieldMap)
    {
        $this->fieldMap = $fieldMap;
    }

    function getFieldWithUserState($field)
    {
        $val = JRequest::getVar($field, '', 'POST');
        // Check if there's a session variable from a previous POST, and use that
        if (empty($val))
        {
            $app = JFactory::getApplication();
            $prevPost = $app->getUserState('com_jfbconnect.registration.data', array());
            if (array_key_exists($field, $prevPost))
                $val = $prevPost[$field];
        }

        if (empty($val))
            $val = $this->getFieldFromMapping($field);

        return $val;
    }

    function getFieldFromMapping($field)
    {
        if (!property_exists($this->fieldMap, $field))
            return "";

        $fieldName = $this->fieldMap->$field;
        return $this->get($fieldName, "");
    }

}

// Deprecated as of v5.1. Use JFBCFactory going forward
class JFBConnectProfileLibrary extends JFBConnectProfileFacebook
{

}
Last edit: 9 years 1 month ago by rebelofoz.
The topic has been locked.
Active Subscriptions:

None
9 years 1 month ago - 9 years 1 month ago #51593 by rebelofoz
One of the two error messages actually went away after logging in (which itself caused over a dozen of error messages). After logging in the only error message is now this:
Warning: Cannot modify header information - headers already sent by (output started at /home/rebelins/public_html/components/com_jfbconnect/libraries/profile.php:119) in /home/rebelins/public_html/components/com_community/libraries/core.php on line 534
Last edit: 9 years 1 month ago by rebelofoz.
The topic has been locked.
Active Subscriptions:

None
9 years 1 month ago #51594 by rebelofoz
I can now no longer add or edit articles because the editor (JCE) can no longer find the default layout.
The topic has been locked.
Active Subscriptions:

None
9 years 1 month ago - 9 years 1 month ago #51595 by rebelofoz
I'm now also getting this error message on the backend of the site.
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 84 bytes) in /home/rebelins/public_html/libraries/joomla/database/driver/mysqli.php on line 811

UPDATE: this particular error message has gone away after increasing the PHP memory on the server to 2048MB.
Last edit: 9 years 1 month ago by rebelofoz.
The topic has been locked.
Support Specialist
9 years 1 month ago #51600 by mel
The only one of your last few issues that actually pertains to JFBConnect is

Warning: Cannot modify header information - headers already sent by (output started at /home/rebelins/public_html/components/com_jfbconnect/libraries/profile.php:119) in /home/rebelins/public_html/components/com_community/libraries/core.php on line 534


We've seen this PHP warning for a long time and I would not be concerned by it. If you are actually encountering functional issues, please let me know. Otherwise, I would ignore the warning (or switch your warning level in the Joomla Global Configuration to something less strict).
The topic has been locked.
Active Subscriptions:

None
9 years 1 month ago #51610 by rebelofoz
Great advice! Both the error message and the problems with the JCE editor went away after switching error reporting to 'standard'. Someone had left error reporting set to maximum when trouble-shooting a different problem and for some reason this only became a problem after upgrading Joomla to version 3.4. What's weird about it is how error reporting stopped the JCE editor from working so that the site could no longer be updated.
The topic has been locked.
Support Specialist
9 years 1 month ago #51613 by mel
Glad that helped you get past the problem. There are always small oddities when upgrading versions of Joomla. I'm sure there will updates/patches to Joomla and many extensions over the coming weeks to fix these small glitches.
The topic has been locked.