Hello,

I have 2 custom modules and they want to use the same modules like this:

if (!empty($lib_path)) {
	      $libraries['FooTable-2'] = array(
		    'title' => 'FooTable-2',
		    'website' => 'http://themergency.com/footable/',
		    'version' => '2.0',
		    'js' => array(
  			  $lib_path . '/js/footable.js' => array(),
		    ),
		    'css' => array(
  			  $lib_path . '/css/footable.standalone.css' => array(
			    'type' => 'file',
			    'media' => 'screen',
			  ),
		    ),
		  );
		  return $libraries;
	  }  
	}

Everything is ok, but I get an error on admin/reports/status page:

Warning: strcmp() expects parameter 2 to be string, array given _system_sort_requirements() függvényben (/web/pranczek/devel.portfoliofotos.hu/modules/system/system.module 2796 sor).
Warning: strcmp() expects parameter 1 to be string, array given _system_sort_requirements() függvényben (/web/pranczek/devel.portfoliofotos.hu/modules/system/system.module 2796 sor).
Warning: strcmp() expects parameter 2 to be string, array given _system_sort_requirements() függvényben (/web/pranczek/devel.portfoliofotos.hu/modules/system/system.module 2796 sor).
Warning: usort() [function.usort]: Array was modified by the user comparison function system_status() függvényben (/web/pranczek/devel.portfoliofotos.hu/modules/system/system.admin.inc 2329 sor).

Is there any good ide to solve this?

Thanks
Adam

Comments

Prancz_Adam’s picture

My system requirements function:

function vip_advertiser_requirements($phase) {
  $requirements = array();
  // Ensure translations do not break at install time
  $t = get_t();

  $requirements['FooTable-2'] = array(
    'title' => $t('FooTable-2 Library'),
  );

  $libraries = libraries_get_libraries();
  if (isset($libraries['FooTable-2'])) {
    $requirements['FooTable-2']['value'] = $t('Installed');
    $requirements['FooTable-2']['severity'] = REQUIREMENT_OK;
  }
  else {
    $requirements['FooTable-2']['value'] = $t('Not Installed');
    $requirements['FooTable-2']['severity'] = REQUIREMENT_ERROR;
    $requirements['FooTable-2']['description'] = $t('Please install the FooTable-2 library %url.', array('%url' => 'https://github.com/bradvin/FooTable'));
  }

  return $requirements;
}
tstoeckler’s picture

Category: Bug report » Support request
Status: Active » Closed (won't fix)

It seems the problem is that you are using a non-unique key in your hook_requirements() implementations(), i.e. you are using the same key in both modules.

It would be nice if Librares API provided some status report on its own, but as it stands that is not the case, thus your support request is not really related to Libraries API.

If you continue having problems please seek assistance through some other medium. If you do believe your problem is related to Libraries API please feel free to re-open.