substr() expects parameter 1 to be string

upgraded php from 5.2.x --> 5.3.x and dolphin 6.1.x has some issues with the version of php. i have worked out most by ~E_DEPRECATED, but this one is something i cant figure out how to get rid of:

 

Warning: substr() expects parameter 1 to be string, array in /path/to/templates/base/scripts/BxBaseFormView.php line 508

 

LINE 508 --> $bUseRekey = ( substr($aInput['Values'], 0, 2) == '#!') ? false : true;
                             switch( $aInput['Control'] ) {
                                   case 'select':
                                      $sCode = '<select class="input_select" name="' . $aInput['Name'] . '">';
                                        foreach( $aValues as $sKey => $sValue ) {
                                       $sSelected = ( $aInput['Value'] == $sKey ) ? ' selected="selected"' : '';

                                       $sLFKey = ($sValue != '_Select it' && $bUseRekey) ? '_FieldValues' . $sValue : $sValue;

                                        $sCode .= '
                                      <option value="' . $this -> value2html( $sKey ) . '"' . $sSelected . '>' .
                                        $this -> value2html( _t( $sLFKey ) ) .
                                        '</option>';
                                         }
                                         $sCode .= '</select>';
                                          break;

 

 

the entire function: starts at line 497 on Dolphin 6.1.6 and 6.1.6

need to know what needs to be done here to work on php 5.3.x

 

 

When a GIG is not enough --> Terabyte Dolphin Technical Support - Server Management and Support
Quote · 9 Jun 2011

Not sure if this will work, but you can try this.

Change this.

LINE 508 --> $bUseRekey = ( substr($aInput['Values'], 0, 2) == '#!') ? false : true;

To This.

LINE 508 --> $bUseRekey = ( substr((string)$aInput['Values'], 0, 2) == '#!') ? false : true;

https://www.deanbassett.com
Quote · 9 Jun 2011

thanks deano. this one was a doozy for me. couldnt find it anywhere, there was no post in the forum here and i know others have had this problem if they upgraded php with dolphin 6.1.x running...

 

 

i created a php.ini file and turned off error reporting. i know that is not the fix, but i had to do something to get rid of the errors.

When a GIG is not enough --> Terabyte Dolphin Technical Support - Server Management and Support
Quote · 9 Jun 2011

applied the recommended solution, and worked beautifully.

thanks:

 

upgrading php from 5.2.x to 5.3.x seems to break the substr function. it is widely written about on other applications, but was not finding the fix, such as what you posted.

dolphin 6.1.x and php 5.3.x dont get along very well. and you have to make a few changes one of which is the header.inc.php

you have to add ~E_DEPRECATED to the error_reporting.

When a GIG is not enough --> Terabyte Dolphin Technical Support - Server Management and Support
Quote · 9 Jun 2011
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.