Jump to content

Services/searchservicefields Returns Nothing


Recommended Posts

Posted

So i have this service

 

blesta.command('services/get', {'service_id': 12})
{'response': {'client_id': '2',
  'coupon_id': None,
  'date_added': '2013-09-16 12:09:11',
  'date_canceled': None,
  'date_last_renewed': None,
  'date_renews': '2013-10-16 12:09:11',
  'date_suspended': None,
  'fields': [{'encrypted': '0',
    'key': 'DomainName',
    'serialized': '0',
    'value': 'fu.ga'}],
  'id': '12',
  'id_code': '12',
  'id_format': '{num}',
  'id_value': '12',
  'module_row_id': None,
  'name': 'fu.ga',
  'package': {'company_id': '1',
   'description': '',
   'description_html': '',
   'id': '1',
   'id_format': '{num}',
   'id_value': '1',
   'module_group': None,
   'module_id': '1',
   'module_row': '0',
   'name': 'Free domains',
   'qty': '87',
   'status': 'active',
   'taxable': '0'},
  'package_group_id': None,
  'package_pricing': {'cancel_fee': '0.0000',
   'currency': 'USD',
   'id': '1',
   'package_id': '1',
   'period': 'month',
   'price': '0.0000',
   'setup_fee': '0.0000',
   'term': '1'},
  'parent_service_id': None,
  'pricing_id': '1',
  'qty': '1',
  'status': 'active'}}

But I'm trying to look it up by the DomainName

 

blesta.command('services/searchServiceFields', {'module_id': 1, 'key': 'DomainName', 'value': 'fu.ga'})
[]

The above code is using a Python wrapper for the API.

Posted

So i have this service

 

blesta.command('services/get', {'service_id': 12})
{'response': {'client_id': '2',
  'coupon_id': None,
  'date_added': '2013-09-16 12:09:11',
  'date_canceled': None,
  'date_last_renewed': None,
  'date_renews': '2013-10-16 12:09:11',
  'date_suspended': None,
  'fields': [{'encrypted': '0',
    'key': 'DomainName',
    'serialized': '0',
    'value': 'fu.ga'}],
  'id': '12',
  'id_code': '12',
  'id_format': '{num}',
  'id_value': '12',
  'module_row_id': None,
  'name': 'fu.ga',
  'package': {'company_id': '1',
   'description': '',
   'description_html': '',
   'id': '1',
   'id_format': '{num}',
   'id_value': '1',
   'module_group': None,
   'module_id': '1',
   'module_row': '0',
   'name': 'Free domains',
   'qty': '87',
   'status': 'active',
   'taxable': '0'},
  'package_group_id': None,
  'package_pricing': {'cancel_fee': '0.0000',
   'currency': 'USD',
   'id': '1',
   'package_id': '1',
   'period': 'month',
   'price': '0.0000',
   'setup_fee': '0.0000',
   'term': '1'},
  'parent_service_id': None,
  'pricing_id': '1',
  'qty': '1',
  'status': 'active'}}

 

I think the problem is that the service's module_row_id is invalid, as it should be an integer representing the module row of the module the service was created for.

 

It seems like one of the following may have occurred when you created the service:

  1. You didn't set a module_row_id
  2. The package didn't have a valid module_row set (I see it's 0 above)
  3. The module you're using did not return the module row when fetching it based on the package module group in Module::selectModuleRow()

Looks like #3 would be why.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...