I just installed dev and it shows on every screen this:
No roles have permission to start any transactions.

I looked at the permissions and there is no "Create transaction content" nor anything about starting transactions under the transactions section.

Comments

matslats’s picture

on admin/marketplace, name the transactions you want to use.
Each named transaction appears on the permissions page with it's machine name
e.g. start incoming_confirm etc
Each permitted transaction type will appear on the transaction form.

JoshSharp’s picture

I checked that there are names in for all of these. Nothing in permissions starting with "start" though. Also, I have noticed three new blank menu items in the create content menu. They point to nothing. I upgraded this to prod after deleting the module folder and untarring dev. Seems like something is amiss. I will try to totally uninstall it and reinstall it again.

JoshSharp’s picture

I have uninstalled the module and reinstalled it with the same problem coming up. On the mass payment form, there are no payees in the payee list.

JoshSharp’s picture

I'm digging all around the code and I found the problem. If you don't have permissions in the permissions table to the transaction types, they never show up on the permissions list to turn them on.

As I am not at all comfortable, nor even able to submit this to cvs I will post it here. I have included the original code and the changed code (with line numbers) and bolded the changes.

./transactions.module

Original:

function transactions_perm() {
  require_once(drupal_get_path('module', 'transactions').'/transactions.inc');
  $perms = array('view all transactions','edit all transactions','configure marketplace');
  foreach(_active_transaction_types() as $machine_name =>$name) {
    $perms[] = 'start ' . $machine_name;
  }
  return $perms;
}

With Changes: (In line 215, sent TRUE as parameter)

212 function transactions_perm() {
213   require_once(drupal_get_path('module', 'transactions').'/transactions.inc');
214   $perms = array('view all transactions','edit all transactions','configure marketplace');
215   foreach(_active_transaction_types(TRUE) as $machine_name =>$name) {
216     $perms[] = 'start ' . $machine_name;
217   }   
218   return $perms;
219 }   

Original:

function _active_transaction_types() {
  static $active_types;
  if ($active_types) return $active_types;
  $valid_types = array();
  $all_types = variable_get('cc_transaction_types', array());
  $type_names=$all_types['transactions'];
  if (!count($type_names)) {
    drupal_set_message(t('There are no longer any transaction types on the system. Please go to admin/marketplace and name some transaction types'));
  }
  $active_types = array();
  //Only the types with names, and the types which the user has permission for
  foreach ($type_names as $machine_name => $name) {
    if (strlen($name) && user_access('start ' . $machine_name)) {
      $active_types[$machine_name] = $name;
    }
  }
  return $active_types;
}

With Changes: (In line 876, added showall parameter and line 888, added bool logic to show all if asked)

/*
874  * Returns an array of transaction_types belonging to this module which have been named
875  */
876 function _active_transaction_types($showall=FALSE) {
877   static $active_types;
878   if ($active_types) return $active_types;
879   $valid_types = array();
880   $all_types = variable_get('cc_transaction_types', array());
881   $type_names=$all_types['transactions'];
882   if (!count($type_names)) { 
883     drupal_set_message(t('There are no longer any transaction types on the system. Please go to admin/marketplace and name some transaction types'));
884   } 
885   $active_types = array();
886   //Only the types with names, and the types which the user has permission for
887   foreach ($type_names as $machine_name => $name) {
888     if (strlen($name) && (user_access('start ' . $machine_name) || $showall)) {
889       $active_types[$machine_name] = $name;
890     }
891   }
892   return $active_types;
893 }

Let me know what you think.

JoshSharp’s picture

One other thing to note. I was not logged in as root, but as my ID and am using the "Admin Role" module to assign admin rights to an "Administrator Role". If I had been root, it would have probably worked without the change.

matslats’s picture

Sorry josh, for not getting to this sooner, it was a bit messy!
I have fixed it in a different way. There are now 2 functions,
_permitted_transaction_types()
and
_named_transaction_types()

matslats’s picture

Status: Active » Closed (fixed)

Yes and this mistake could only happen if you were developing not as admin