Results 1 to 2 of 2

Thread: zExtendedRegistration - throws errors - not working 2.11.4

  1. #1
    User
    Join Date
    09-08-09.
    Location
    Snellville, GA
    Posts
    194

    Default zExtendedRegistration - throws errors - not working 2.11.4

    Good morning:

    I installed a copy of z Extended Registration extension which I think might help one of my clients with some of its features including "recommending" another person to register. The installation went smoothly, but when I clicked on the "member" link in the Account Manager Contao goes to a white screen of death.

    Error log shows

    Code:
    [06-Jul-2012 16:50:53] PHP Parse error:  syntax error, unexpected ':' in /home/wavedev3/public_html/system/modules/zExtendedRegistration/dca/tl_module.php on line 228
    Line 228 in Dreamweaver of the tl_module.php file has a red highlight on it for the error, and the line is in this block

    Code:
    // add additional fields from form to field list
    		if($dc->activeRecord->extReg_addformfields)
    		{
    			// get form fields selected
    			$objFormfields = $this->Database->prepare("SELECT * FROM tl_form_field WHERE pid=? AND invisible!=1 ORDER BY sorting")
    							->execute($dc->activeRecord->extReg_form);
    	
    			if(!$objFormfields->numRows)
    			{
    				return $return;
    			}
    			
    			while($objFormfields->next())
    			{
    				if(!strlen($objFormfields->label))
    				{
    					$objFormfields->label = $objFormfields->name ?: $objFormfields->type . $objFormfields->id; //1 - LINE 228
    				}	
    				if(!strlen($objFormfields->name))
    				{
    					$objFormfields->name = $objFormfields->type . $objFormfields->id;
    				}
    				
    				$return[$objFormfields->name] = $objFormfields->label . ' <span style="color:#b3b3b3">['.$objFormfields->name.':'.$objFormfields->type.']</span>';
    				
    			}
    		}
    If I take Line 228

    Code:
    $objFormfields->label = $objFormfields->name ?: $objFormfields->type . $objFormfields->id; //1
    and modify it to

    Code:
    $objFormfields->label = $objFormfields->type . $objFormfields->id; //1
    the error flag in Dreamweaver clears but then I get multiple errors when I click on the "Member" link. Errors thrown now are:

    Code:
    [10-Jul-2012 11:55:53] PHP Parse error:  syntax error, unexpected ':' in /home/wavedev3/public_html/system/modules/zExtendedRegistration/dca/tl_member.php on line 304
    [10-Jul-2012 11:58:51] PHP Fatal error: Uncaught exception 'SoapFault' with message 'Error Fetching http headers' thrown in /home/wavedev3/public_html/system/modules/rep_client/RepositoryBackendModule.php on line 221
    I went ahead and uninstalled the extension manually and ran the install tool to clear the database. Anybody have any ideas on this or already have a solution?

    Ernest McDermon
    Snellville, GA

  2. #2
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Re: zExtendedRegistration - throws errors - not working 2.11

    Ernest, I think this extension will only run on php 5.3
    The author has used terniary shorthand in his code (recognised by php 5.3 and up) which means it is really only compatable with Contao 3 (which will also require php5.3) - as the system requirements for Contao 2.x.x are php 5.2.

    Terniary shorthand is
    Code:
    $objFormfields->label = $objFormfields->name ?: $objFormfields->type . $objFormfields->id;
    instead of
    Code:
    $objFormfields->label = ($objFormfields->name ?$objFormfields->name : $objFormfields->type . $objFormfields->id);
    The author should change all instances of this if he wants it truly compatable with Contao 2.x.x

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •