Comments

kylebrowning’s picture

Status: Active » Needs review
kylebrowning’s picture

kylebrowning’s picture

Im not sure how to remove the trailing whitepsace warnings. :(

ygerasimov’s picture

StatusFileSize
new41.75 KB

Here is patch that can be applied after http://drupal.org/node/855392#comment-4232904 that fixes whitespaces plus:
- fixes code styling problems
- some refactoring
- add validation on resources form (I can't get proper highligting of wrong alias field)

Please review.

kylebrowning’s picture

My name is Kyle Browning, and I approve this patch!

kylebrowning’s picture

StatusFileSize
new69.63 KB

Updated patched for current 7.x-3.x branch

marcingy’s picture

First pass review

Can we look to use #attach rather than drupal_add_css and drupal_add_js as this is the norm in d7.

I'm sure there are some other bits and pieces but this is first thing that springs out at me.

Leaving at needs review so as you get additional comments.

I'll do a second pass when I'm more awake tomorrow.

kylebrowning’s picture

StatusFileSize
new26.87 KB

Updated patch for marcingy's comments

marcingy’s picture

Few minor things (sorry)

* in services_edit_form_endpoint_resources instead of calling drupal_get_path twice assign the value to a variable ie

$path = drupal_get_path('module', 'services');

$form['#attached']['css'] = array(
  $path . '/css/services.admin.css',
);

Can this be reworked

+    $alias = '';
+    if (isset($endpoint['build_info']['args'][0]->resources[$resource]['alias'])) {
+      $alias = $endpoint['build_info']['args'][0]->resources[$resource]['alias'];
+    }
+    if (isset($endpoint['input'][$resource . '/alias'])) {
+      $alias = $endpoint['input'][$resource . '/alias'];

to be something along these line, ie we only do one if comparision?

  $alias = '';
  if (isset($endpoint['build_info']['args'][0]->resources[$resource]['alias'])) {
     $alias = $endpoint['build_info']['args'][0]->resources[$resource]['alias'];
   }
   elseif (isset($endpoint['input'][$resource . '/alias'])) {
     $alias = $endpoint['input'][$resource . '/alias'];

We have some formatting issue here

if(!in_array($class, $ignoreArray)) {
  if(!isset($info['help'])) {
    $description = t('No description is available')
  } else {
      $description = $info['help'];
  }

should be

if (!in_array($class, $ignoreArray)) {
  if (!isset($info['help'])) {
    $description = t('No description is available')
  } 
  else {
     $description = $info['help'];
  }

There are similar issue further down in services_edit_form_endpoint_resources and else if should be elseif

There are 2 full stops on this line

* Resources form submit function..
kylebrowning’s picture

StatusFileSize
new26.87 KB

Updated patch.

kylebrowning’s picture

StatusFileSize
new26.87 KB

woops

kylebrowning’s picture

Updated patch

ygerasimov’s picture

StatusFileSize
new27.5 KB

Patch #12 introduces some trailing spaces. I have removed them.

marcingy’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

Status: Patch (to be ported) » Fixed

Status: Fixed » Closed (fixed)

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