Programmare azioni modulo custom

3 contenuti / 0 new
Ultimo contenuto
Anonimo (non verificato)
Ritratto di Anonimo
Programmare azioni modulo custom

Ciao a tutti,
come si programmano le azioni-trigger-rule?
Purtroppo questo codice mi da un errore di sistema, cosa ho dimenticato?

<?
function social_autopost_action_info() {
return array(
'social_autopost_publishonsocial_action' => array(
'type' => 'node',
'label' => t('Social auto post on social Network'),
'configurable' => TRUE,
'triggers' => array('any'),
'vbo_configurable' => TRUE,
'behavior' => array('changes_property'),
),
);
}

function social_autopost_publishonsocial_action_form($context){
$form['okpublish'] = array(
'#type' => 'checkbox',
'#title' => t('Sen on social all content queue'),
'#default_value' => TRUE,
);
return $form;

}

/**
* Submit handler for action_example_node_sticky_action.
*
* Returns an associative array of values which will be available in the
* $context when an action is executed.

function social_autopost_publishonsocial_action_submit($form, $form_state) {
return array('okpublish' => $form_state['values']['okpublish']);
}
/*
* These are my implementation of the action:

function social_autopost_publishonsocial_action(&$node, $context = array()) {
$node = $context['node'];
$okpublish = $context['okpublish'];

// codice che pubblica il post sui social
watchdog('action', 'Set @type %title to autopost on twitter.', array('@type' => node_get_types('name', $node), '%title' => $node->title));
}
?>

Grazie in anticipo per la risposta

Drupal Version:

Ciao, quale è l'errore di sistema ?

M.

--
Michel 'ZioBudda' Morelli -- [email protected]
Sviluppo applicazioni CMS DRUPAL e web dinamiche -- Corsi Drupal -- Amministrazione Drupal -- Hosting Drupal

Meggis (non verificato)
Ritratto di Anonimo

Ciao, il messaggio è questo:

The errors are An active access token must be used to query information about the current user. @message

I passi che eseguo sono:
1. Aggiunta azione
2. Assegnazione del trigger > dopo salvataggio nodo
3. Aggiunta nodo, salvo = errore

Spero di risolvere :)