On the Views Data Configuration screen, Web Services Client Views in not properly expanding a data type in the Result Row Data table when the Data Type has the 'multiple' option enabled (on the edit Data Type screen). If I were to go to the edit Data Type screen for this field and disable the 'multiple' option, the field will properly expand (although this is not be helpful as it violate the data structure of the web service response for the particular operation of reference).

Anyhow, if i were to check the box "expand" for this field and then save this particular Views Data Configuration, on the wsclient_views.admin.inc, on page refresh I receive the error messages:

Notice: Undefined index: list in wsclient_views_nested_property_info() (line 207 of /drupal/sites/all/modules/web_services_client_views/wsclient_views.module).
Warning: Invalid argument supplied for foreach() in wsclient_views_configuration() (line 113 of /drupal/sites/all/modules/web_services_client_views/wsclient_views.admin.inc).

This is a copy of line 207 from wsclient_views.module:

  $property_info = $datatypes[$root_part]['property info'];

This is a copy of lines 113-118 from wsclient_views.admin.inc:

          foreach ($sub_type as $ind => $sub) {
          $form['operation']['results']['result_row'][$id . ':' . $ind] = array(
            '#type' => 'container',
            '#attributes' => array('class' => array('result')),
            '#weight' => 10,
          );

Comments

freddura’s picture

Category: task » bug
stone_d’s picture

Im stucking exactly there! I always get the error-messages even if "multiple" isnt clicked:
Notice: Undefined index: text in wsclient_views_nested_property_info() (Zeile 207 von /xxx/xxx/Sites/xxx/sites/all/modules/web_services_client_views/wsclient_views.module).
Warning: Invalid argument supplied for foreach() in wsclient_views_configuration() (Zeile 113 von /xxx/xxx/Sites/xxx/sites/all/modules/web_services_client_views/wsclient_views.admin.inc).

And if i click "multiple" it throws
Notice: Undefined index: list in wsclient_views_nested_property_info() (Zeile 207 von /xxx/xxx/Sites/xxx/sites/all/modules/web_services_client_views/wsclient_views.module).
Warning: Invalid argument supplied for foreach() in wsclient_views_configuration() (Zeile 113 von /xxx/xxx/Sites/xxx/sites/all/modules/web_services_client_views/wsclient_views.admin.inc).

Any updates? I would love to have this function since the idea of integrating external services with views is GREAT and would be very useful e.g. for using external a workflow-management application.

Thanks in advance and best regards,
F.

stone_d’s picture

oh damn - now i stuck at the same as you.
My JSON result looks like: {"data":[{"id":"805","variables":[]},{"id":"806","variables":[]},{"id":"807","variables":[]}]}

I created a nested datatype "result (of type data)" -> "data ('id' as 'text')" and i guess thats the right way how to do it.
My "result" has multiple values (checked checkbox "multiple" in the properties-settings of the datatype "result"). So when i click "expand" within the "views configuration" it it throws the same errors :/

Did you solve your issue already? And if yes: How you did it?

Thanks and greets,
F.

PatchRanger’s picture

Argh! That is too hard to reproduce the pre-requirement to me.
I tried to use my Recurly service description. It failed due to "Failed unserialize response" - known problem, which is described here: #1280332: Advanced REST service formatters + UI setting. The patch is "needs work" there - so I guess I should debug that patch first to get it committed.
Another problem is that we have to test everything manually - I guess we should create infrastructure for Simpletest testing. In my view Services (possibly with Services Entity API or Services Views) is a good way to go.

stone_d’s picture

Im not that much involved into "Simpletest". Please instruct me what to do to help solving the above issue.

PatchRanger’s picture

@stone_d Take a look at https://drupal.org/simpletest-tutorial-drupal7 for a start. Creating Simpletest-tests is most about coding as there is nothing to do via UI. Running - yes, it could be done via UI as well as via Drush command-line interface - but before running we need to create what is going to be launched.
The plan of the testing scenario should look as follows:

  • Enable modules: Wsclient, Wsclient Views, Services, Services Entity.
  • Define Web Service Description for Wsclient module to access entities via service, provided by Services Entity.
  • Enable Wsclient Views and configure it to expand complex data types.
  • Create View, which contains that complex data.
  • Ensure ("assert" in terms of Simpletest) that complex data is correctly displayed.

I hope I am clear enough.

stone_d’s picture

ok ... does that mean you will setup the environment for testing?
I could search for a free-JSON-service that provides complex-data to test the expanding and create the needed operations. I guess i cant help with the coding-stuff :/

PatchRanger’s picture

does that mean you will setup the environment for testing?

That is the plan though I have no idea about when it is going to become real, because it is quite huge piece of work =/

stone_d’s picture

... does this (=> https://drupal.org/node/1280332) really need to be fixed before working on this issue in here? :/

PatchRanger’s picture

It is only needed in case if we prefer manual testing - which is definitely not the option.
I guess we should choose another opportunity: create Simpletest-tests to cover this concrete use case. Once it is done, we could create a patch, which fixes this concrete issue by making that test passed.

stone_d’s picture

ok - that sounds good to me. What can i do to accelerate the process of fixing this concrete issue here? :)