Hey,
I am using Services 3 with afmserver to deliver content to a Flashapp, but a warning keeps popping up in my logmessages.

undefined index: amfserver in services_endpoint_callback()

What does this mean? and how can I solve it?

Regards
Lars Nielsen

Comments

larsmw’s picture

Does this mean that amfserver does not set a required index-parameter to the services integration?

/Lars Nielsen

larsmw’s picture

This is the exact "error" message :
Notice: Undefined index: amfserver in services_endpoint_callback() (line 196 of /var/aegir/platforms/fimd7platform/sites/all/modules/services/services.module).

Has anyone else seen this? Is it an error in amfserver?

/Lars Nielsen

SlyK’s picture

Got it too :( Enybody knows how to fix this?

It seems like for 'amfserver' server_settings is just empty array, because amfserver have no settings:

stdClass Object
(
    [eid] => 3
    [name] => amf3
    [server] => amfserver
    [path] => api/amf3
    [authentication] => Array
        (
            [services] => services
        )

    [server_settings] => Array
        (
        )

    [resources] => Array
        (
        )

    [debug] => 1
    [table] => services_endpoint
    [type] => Normal
    [export_type] => 1
)

So error drops:

'settings'      => $endpoint->server_settings[$server_name],

I've tried XMLRPC server and received the same error, so maybe Services need to add isset() check for server_settings param:
Undefined index: xmlrpc_server in services_endpoint_callback() (line 196 of Z:\home\nfeya.com\www\sites\all\modules\services\services.module).

SlyK’s picture

There is a patch:
http://drupal.org/node/1344852

So maybe in latest dev build the problem is fixed.
If you just want fix your existing module, go to
b>sites\all\modules\services\plugins\export_ui\services_ctools_export_ui.inc
and add last line:

$endpoint->path   = $form_state['values']['path'];
$endpoint->debug  = $form_state['values']['debug']; //find this line and...
$endpoint->server_settings = array($endpoint->server => array()); //add this line in services_ctools_export_ui_form_submit() func

After that you need resave your current amfphp server settings here: /admin/structure/services/list/

larsmw’s picture

I have now tried this on both services 3.0 and 3.1 and it didnt remove the notice. Is this patch only working on dev version?

amfserver is broken if i install the dev-version of services so i have a little trouble testing this right now.

/Lars Nielsen

qasimzee’s picture

The patch worked for me

--
Qasim Zeeshan
http://qasimzeeshan.com