Problems with options_connector.php

Hi all,

Been pulling my hair out with this all day and would really appriciate a little help

I Have this selection box in one of the forms on my page:


{type: "select", name:"addAreaSel",label: "Add area preference",
  connector:"resources/lib/cons/mySettings/prefrences_selectConnect.php"},

and I ve been trying to auto populate it with data from a db as per the tutorial here:
http://docs.dhtmlx.com/doku.php?id=dhtmlxconnector:selectoptionsconnector

but whenever I do I get :

[b]

( ! ) Strict standards: Only variables should be assigned by reference in C:\wamp\www\codebase\connector\base_connector.php on line 62
Call Stack
# Time Memory Function Location
1 0.0025 373232 {main}( ) ..\areaPrefrences_selectConnect.php:0
2 0.0400 1052600 Connector->render_table( ) ..\prefrences_selectConnect.php:30
3 0.0402 1053616 Connector->render( ) ..\base_connector.php:279
4 0.0402 1054048 SortInterface->__construct( ) ..\base_connector.php:328
( ! ) Strict standards: Only variables should be assigned by reference in C:\wamp\www\codebase\connector\base_connector.php on line 85
Call Stack
# Time Memory Function Location
1 0.0025 373232 {main}( ) ..\prefrences_selectConnect.php:0
2 0.0400 1052600 Connector->render_table( ) ..\prefrences_selectConnect.php:30
3 0.0402 1053616 Connector->render( ) ..\base_connector.php:279
4 0.0406 1054168 FilterInterface->__construct( ) ..\base_connector.php:329
( ! ) Fatal error: Call to undefined method OptionsDataItem::xmlentities() in C:\wamp\www\codebase\connector\options_connector.php on line 17
Call Stack
# Time Memory Function Location
1 0.0025 373232 {main}( ) ..\prefrences_selectConnect.php:0
2 0.0400 1052600 Connector->render_table( ) ..\prefrences_selectConnect.php:30
3 0.0402 1053616 Connector->render( ) ..\base_connector.php:279
4 0.0427 1055808 Connector->output_as_xml( ) ..\base_connector.php:330
5 0.0427 1055808 Connector->render_set( ) ..\base_connector.php:412
6 0.0428 1056624 OptionsDataItem->to_xml( ) ..\base_connector.php:401

[/b]

Now from the research I’ve done I dont think this is strictly (excuse the pun :slight_smile: ) an error its actually PHP warning me that it does’nt recommend passing results from object methods by reference in the base connector class.
Im using PHP 5.3.5 and I’v tried configuring the .ini in every which way I can think of but nothing seems to work, and its stopping my selection boxes from functioning.

for references heres my php connection class:

 $conn = mysql_connect($host, $userName, $pwd);
    mysql_select_db($dbName);

    
    // create a new selections connector object and pass it the DB connection
    $areaSelectData = new SelectOptionsConnector($conn, "MySQL");
    $areaSelectData->enable_log("log.txt");
    
    // populate the selection box with data from the transport type look-up table using transport type id as
    // value and description as the lable
    $areaSelectData->render_table("pCode", "Area_Code", " Area_Code, Area_Name");

and heres the log:

 SELECT `Area_Code`,`Area_Code`,`Area_Name` FROM pCode 

Which looks a little odd to me as it seems to be selecting the same field twice :confused: .

Sorry about the long windedness but can anyone help please ??

While two messages at start are not really errors, the third one is real error

Please try to grab connector 1.5 package from
dhtmlx.com/docs/products/dht … ndex.shtml
I double-checked, and in latest version the above error must not occur.

Hi again,

Thanks Stanislav that seems to have worked, with one slight note, when I orginally updated the connector files I go the following error:




<font size='1'><table class='xdebug-error' dir='ltr' border='1' cellspacing='0' cellpadding='1'>
<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Fatal error: Access level to GridConnector::$options must be protected (as in class Connector) or weaker in C:\wamp\www\codebase\connector\grid_connector_v2.php on line <i>132</i></th></tr>
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0008</td><td bgcolor='#eeeeec' align='right'>379752</td><td bgcolor='#eeeeec'>{main}(  )</td><td title='C:\wamp\www\resources\lib\cons\mySettings\transportPreferences_gridConfig.php' bgcolor='#eeeeec'>..\transportPreferences_gridConfig.php<b>:</b>0</td></tr>
<tr><td bgcolor='#eeeeec' align='center'>2</td><td bgcolor='#eeeeec' align='center'>0.0506</td><td bgcolor='#eeeeec' align='right'>467560</td><td bgcolor='#eeeeec'>require_once( <font color='#00bb00'>'C:\wamp\www\codebase\connector\grid_connector_v2.php'</font> )</td><td title='C:\wamp\www\resources\lib\cons\mySettings\transportPreferences_gridConfig.php' bgcolor='#eeeeec'>..\transportPreferences_gridConfig.php<b>:</b>12</td></tr>
</table></font>

that relates back to this line of code (134) in the grid connector class

private $options=array();

Which Im guessing means in the latest version of the connector files some other class needs access to this array (my knowledge of Java is far better than that of OO PHP so I may be totally wrong :slight_smile: )
So I changed its access modifier and now things seem to be working, can you see this change causing any problems? If so Ill make whatever other changes you suggest otherwise Ill leave it as it is.

Thanks again.

Ooops spoke to soon,

I’ve just run my site through some tests and picked up some problems since the update,

Firstly, my error logs for the options connectors are strewn with the following:

Undefined property: SelectOptionsConnector::$extra_output at C:\wamp\www\codebase\connector\base_connector.php line 714 

Also the delete function for one of the grids no longer works, this may or may not be connected to the update but I’ve not changed any of the code directly since the update so I assume it has somthing to do with it.

Any one got any ideas please?