Comments

amitaibu’s picture

Status: Active » Needs review
StatusFileSize
new46.77 KB

[edit: deleted double posting]

amitaibu’s picture

StatusFileSize
new46.77 KB

Patch moves all custom code from admin.inc into CTools' export-ui
plugin.

It should be working but I haven't fully tested since I'm not yet
familiar enough with Services. . I've set it to needs review, though, so
it will get attention, although it might need a bit more polish.

I don't think I'll have more time to spend on this patch, but I hope and
believe -- since all pieces are in place -- it will help the maintainers
finalizing it. I'll of course be here for questions.

After applying patch, cache clear, navigate to admin/build/services and
be pleasantly surprised... :)

Status: Needs review » Needs work

The last submitted patch, export-ui-services.patch, failed testing.

amitaibu’s picture

I was thinking that another possible is to use the wizard to add the resources and authentication -- sounds like a better usability.

voxpelli’s picture

Subscribing to keep track so that this doesn't get lost :)

kylebrowning’s picture

Status: Needs work » Closed (fixed)

The export UI is currently working in 3.x-dev

voxpelli’s picture

Status: Closed (fixed) » Needs work

This is not in Services 3.x - restoring status.

kylebrowning’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev

Soo, bumping this to 7.x

We now have a feature branch located here, http://drupalcode.org/project/services.git/shortlog/refs/heads/master-ct...

I have started moving this over AND updating the UI saving resources.

dixon_’s picture

Interesting, subscribing

kylebrowning’s picture

Status: Needs work » Needs review
StatusFileSize
new23.19 KB

Ok, heres a new patch, needs review.

This updates Services to use ctools export UI.

kylebrowning’s picture

StatusFileSize
new30.61 KB

Eek, updated patch

marcingy’s picture

Status: Needs review » Needs work

I haven't tested this patch functionally but from a eyeballing we are missing doxygen in a number of place and some @param values are missing types. Yes I realise this is a nip pick in some ways but documented code is good code ;)

kylebrowning’s picture

Status: Needs work » Needs review
StatusFileSize
new24.42 KB

Ok, heres updated patch with some more comments.

ygerasimov’s picture

StatusFileSize
new24.43 KB

Here is same patch without trailing spaces. I will do more precise review with corrections in #1096316: Resource UI is lacking a good UX

kylebrowning’s picture

Status: Needs review » Reviewed & tested by the community
ygerasimov’s picture

after installing module I get error:

Notice: Undefined variable: items in services_menu() (line 95 of /var/www/services/d7/sites/all/modules/services/services.module).

Here is amended patch to fix this problem.

ygerasimov’s picture

Added hook_requirements to check version of CTools.

gdd’s picture

Status: Reviewed & tested by the community » Needs work

Some more comments after trying this out.

- I don't understand why we need both a 'Name' and a 'Endpoint Name' when creating a new endpoint. They are both supposed to be unique so what's the point?

- When I create a new endpoint and enter 'test' for all fields, REST as server, and click either 'Save' or 'Save and proceed' I get the following PDO error, although the endpoint does actually get created. This also happens if you Clone or Import an endpoint.

PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1' for key 'PRIMARY': INSERT INTO {services_endpoint} (eid, name, title, server, path, authentication, resources, debug) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => test [:db_insert_placeholder_2] => test [:db_insert_placeholder_3] => rest_server [:db_insert_placeholder_4] => test [:db_insert_placeholder_5] => a:0:{} [:db_insert_placeholder_6] => a:0:{} [:db_insert_placeholder_7] => 0 ) in drupal_write_record() (line 6774 of /Users/gdd/htdocs/services_7/includes/common.inc).

- What is the difference between 'Save' and 'Save and Proceed'?

- When I go to edit a service I have two Save buttons.

- When saving the Resources page I get the following notice

Notice: Trying to get property of non-object in services_endpoint_save() (line 268 of /Users/gdd/htdocs/services_7/sites/all/modules/services/services.module).

- Didn't we used to have a List tab so you could get back to the endpoint index without going to the breadcrumb?

gdd’s picture

So for the record, I just tried #17 out with a fresh install, a new checkout of the 7.x-3.x branch, and alpha3 of CTools, and I am still getting these same results.

kylebrowning’s picture

Status: Needs work » Needs review
StatusFileSize
new47.67 KB

Updates CTOOLs patch

Fixes tests, Resources page errors, Various Submit buttons, and rollls all the previous patches into one.

ygerasimov’s picture

Status: Needs review » Needs work

I have enabled services module only on fresh install. When I try to create endpoint I don't have any choice in Server selecbox (that is right as I haven't enabled any servers). But when I submit and get validation error I also have error
Warning: implode() [function.implode]: Invalid arguments passed in form_error() (line 1576 of /var/www/services/d7/includes/form.inc).
I also get this error when enable rest server and create endpoint (no validation errors).

I have managed to create endpoint with name that has spaces and capital letters. I believe this should be impossible. But in my case validation accepted this.

I have also tried to export / import endpoint. This worked fine.

What is really needed is to have validation on path as I exported / imported same endpoint with change of name but not changing path. So it happened to exist two endpoints with same pathes.

kylebrowning’s picture

StatusFileSize
new48.21 KB

Updated patch address issues in #21

kylebrowning’s picture

Status: Needs work » Needs review
ygerasimov’s picture

Status: Needs review » Needs work

After I import the endpoint I can't save it. I get all the time error
The export id can only consist of lowercase letters, underscores, and numbers.
Screenshot: http://skitch.com/ygerasimov/rsqea/selection-014

This happened after I named endpoint with capital letters, exported it and tried to import.

kylebrowning’s picture

IM not able to reproduce this :(

kylebrowning’s picture

StatusFileSize
new48.2 KB

Ok, this seems to be a CTOOLs bug, ill open a patch over there when I get to one, but theres a new patch to be applied to 7.x-3.x

kylebrowning’s picture

Status: Needs work » Needs review
StatusFileSize
new48.22 KB

OK, heres a patch that should fix the Uppercase issues. Endpoint names must follow ctools primary key naminving convention of lowercase 0-9 and underscores.

ygerasimov’s picture

Status: Needs review » Needs work

Works much better. I haven't found any bugs.

ygerasimov’s picture

Status: Needs work » Reviewed & tested by the community

Set to RTBC

kylebrowning’s picture

Gonna let hejrocker do one more pass, then Ill commit.

marcingy’s picture

Status: Reviewed & tested by the community » Needs work

I have some concerns about services_edit_form_endpoint_resources_submit as there are variable names such as $c being used. I simply can't tell what on earth is going on that function because we don't have meaningful names.

Is this code correct

if (!empty($rop['endpoint']['preprocess'])) {
+      $settings['preprocess'] = array(
+        '#type' => 'item',
+        '#title' => t('Preprocess function'),
+        '#value' => $rop['endpoint']['preprocess'],
+      );
+    }
+
+    if (!empty($rop['endpoint']['postprocess'])) {
+      $settings['preprocess'] = array(
+        '#type' => 'item',
+        '#title' => t('Postprocess function'),
+        '#value' => $rop['endpoint']['Postprocess'],
+      );
+    }

As we are setting preprocess in both cases.

Looks like we have a typo.

'title singular proper' => t('Endppint'),

Do we need dynamic queries in services_ctools_export_ui_form_validate or can we just use dbquery with placeholder? I think we can but I'm not 100% certain.

Can we do an isset rather than checking for key exists as this is more performant

 if(is_array($endpoint) && array_key_exists('build_info', $endpoint)) 
kylebrowning’s picture

Status: Needs work » Needs review
StatusFileSize
new48.77 KB

Updated patch fixing marcingy's comments

kylebrowning’s picture

StatusFileSize
new63.04 KB

Woops, updated patch, my bad

kylebrowning’s picture

Status: Needs review » Reviewed & tested by the community
kylebrowning’s picture

Version: 7.x-3.x-dev » 6.x-3.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)
kylebrowning’s picture

hers 6.x version of the ctools update

kylebrowning’s picture

Status: Patch (to be ported) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.