Submitted by GSAnthony on
Bonjour,
Voilà, j'ai un soucis avec mon formulaire que je viens de créer. Lorsque je clique sur le bouton Submit, il ne se passe rien.
Je n'arrive pas à trouver mon erreur (elle doit sûrement être simple mais bon je ne la trouve pas quand même ^^' ).
Merci d'avance pour votre aide, je vous laisse jeter un oeil à mon code :
/**
* Implementation of hook_permission().
*/
function migrate_account_permission() {
return array(
'access migrate_account' => array(
'title' => 'Autorise la possibilité de migrer de type de compte',
'description' => '',
),
);
}
/**
* Implements hook_menu().
*/
function migrate_account_menu() {
$items['migrate/account'] = array(
'title' => 'Migration du type de compte',
'page callback' => 'migrate_account_migration_form',
'access arguments' => array('access migrate_account'),
'type' => MENU_CALLBACK,
);
return $items;
}
function migrate_account_migration_form() {
global $user;
$own = $user->uid;
$option = array();
$result = db_query("SELECT rid, name FROM {role} WHERE rid!=3 AND rid!=2 AND rid!=1");
foreach ($result as $record) {
$option[$record->rid] = $record->name;
}
$form['account'] = array(
'#type' => 'select',
'#title' => t('Choisissez votre nouveau type de compte'),
'#options' => $option,
'#default_value' => '',
'#description' => t('Vous devez choisir vers quel type de compte migrer.'),
);
$form['submit'] = array('#type' => 'submit', '#value' => t('Submit'), '#submit' => array('migrate_account_migration_form_submit'));
var_dump($form);
return $form;
}
function migrate_account_migration_form_submit($form, &$form_state) {
var_dump($form_state);
var_dump($form);
$result = db_query("UPDATE users_roles SET uid = :uid, rid = :rid WHERE {condition}", array(':uid' => $form_state['account'], ':rid' => $form_state['account']));
}
Bonjour, Quand tu dis qu’il
Permalien Soumis par NetOctet le 13 Août, 2012 - 13:26
Bonjour,
Quand tu dis qu'il ne se passe rien, tu peux être plus précis ? Il y a bien un rechargement de la page quand même non ?
Au cas où, donne le code HTML renvoyé par Drupal avec le bouton Submit. :) (Voire l'ensemble de ton formulaire).
Non justement, il n’y a aucun
Permalien Soumis par GSAnthony le 13 Août, 2012 - 13:40
Non justement, il n'y a aucun rechargement de la page. Je te donne quand même le code source de la page :
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML+RDFa 1.1//EN">
<html lang="fr" dir="ltr" version="HTML+RDFa 1.1"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/terms/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:og="http://ogp.me/ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:sioc="http://rdfs.org/sioc/ns#"
xmlns:sioct="http://rdfs.org/sioc/types#"
xmlns:skos="http://www.w3.org/2004/02/skos/core#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#">
<head profile="http://www.w3.org/1999/xhtml/vocab">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
<meta name="Generator" content="Drupal 7 (http://drupal.org)" />
<link rel="shortcut icon" href="http://localhost/EventMust/misc/favicon.ico" type="image/vnd.microsoft.icon" />
<title>Migration du type de compte | Event Must</title>
<style type="text/css" media="all">@import url("http://localhost/EventMust/modules/system/system.base.css?m8nmll");
@import url("http://localhost/EventMust/modules/system/system.menus.css?m8nmll");
@import url("http://localhost/EventMust/modules/system/system.messages.css?m8nmll");
@import url("http://localhost/EventMust/modules/system/system.theme.css?m8nmll");</style>
<style type="text/css" media="all">@import url("http://localhost/EventMust/modules/contextual/contextual.css?m8nmll");</style>
<style type="text/css" media="all">@import url("http://localhost/EventMust/modules/comment/comment.css?m8nmll");
@import url("http://localhost/EventMust/sites/all/modules/date/date_api/date.css?m8nmll");
@import url("http://localhost/EventMust/sites/all/modules/date/date_popup/themes/datepicker.1.7.css?m8nmll");
@import url("http://localhost/EventMust/modules/field/theme/field.css?m8nmll");
@import url("http://localhost/EventMust/sites/all/modules/myfollow/myfollow.css?m8nmll");
@import url("http://localhost/EventMust/modules/node/node.css?m8nmll");
@import url("http://localhost/EventMust/modules/search/search.css?m8nmll");
@import url("http://localhost/EventMust/modules/user/user.css?m8nmll");</style>
<style type="text/css" media="all">@import url("http://localhost/EventMust/sites/all/modules/ctools/css/ctools.css?m8nmll");
@import url("http://localhost/EventMust/modules/shortcut/shortcut.css?m8nmll");
@import url("http://localhost/EventMust/modules/toolbar/toolbar.css?m8nmll");</style>
<style type="text/css" media="all">@import url("http://localhost/EventMust/sites/all/themes/omega/alpha/css/alpha-reset.css?m8nmll");
@import url("http://localhost/EventMust/sites/all/themes/omega/alpha/css/alpha-mobile.css?m8nmll");
@import url("http://localhost/EventMust/sites/all/themes/omega/alpha/css/alpha-alpha.css?m8nmll");
@import url("http://localhost/EventMust/sites/all/themes/omega/omega/css/formalize.css?m8nmll");
@import url("http://localhost/EventMust/sites/all/themes/omega/omega/css/omega-text.css?m8nmll");
@import url("http://localhost/EventMust/sites/all/themes/omega/omega/css/omega-branding.css?m8nmll");
@import url("http://localhost/EventMust/sites/all/themes/omega/omega/css/omega-menu.css?m8nmll");
@import url("http://localhost/EventMust/sites/all/themes/omega/omega/css/omega-forms.css?m8nmll");
@import url("http://localhost/EventMust/sites/all/themes/omega/omega/css/omega-visuals.css?m8nmll");</style>
<!--[if (lt IE 9)&(!IEMobile)]>
<style type="text/css" media="all">@import url("http://localhost/EventMust/sites/all/themes/omega/alpha/css/grid/alpha_default/normal/alpha-default-normal-12.css?m8nmll");</style>
<![endif]-->
<!--[if gte IE 9]><!-->
<style type="text/css" media="all and (min-width: 740px) and (min-device-width: 740px), (max-device-width: 800px) and (min-width: 740px) and (orientation:landscape)">@import url("http://localhost/EventMust/sites/all/themes/omega/alpha/css/grid/alpha_default/narrow/alpha-default-narrow-12.css?m8nmll");</style>
<!--<![endif]-->
<!--[if gte IE 9]><!-->
<style type="text/css" media="all and (min-width: 980px) and (min-device-width: 980px), all and (max-device-width: 1024px) and (min-width: 1024px) and (orientation:landscape)">@import url("http://localhost/EventMust/sites/all/themes/omega/alpha/css/grid/alpha_default/normal/alpha-default-normal-12.css?m8nmll");</style>
<!--<![endif]-->
<!--[if gte IE 9]><!-->
<style type="text/css" media="all and (min-width: 1220px)">@import url("http://localhost/EventMust/sites/all/themes/omega/alpha/css/grid/alpha_default/wide/alpha-default-wide-12.css?m8nmll");</style>
<!--<![endif]-->
<script type="text/javascript" src="http://localhost/EventMust/misc/jquery.js?v=1.4.4"></script>
<script type="text/javascript" src="http://localhost/EventMust/misc/jquery.once.js?v=1.2"></script>
<script type="text/javascript" src="http://localhost/EventMust/misc/drupal.js?m8nmll"></script>
<script type="text/javascript" src="http://localhost/EventMust/modules/contextual/contextual.js?v=1.0"></script>
<script type="text/javascript" src="http://localhost/EventMust/misc/jquery.cookie.js?v=1.0"></script>
<script type="text/javascript" src="http://localhost/EventMust/sites/default/files/languages/fr_JQ3DR68lWFNdYdiBl5wvoJJA9jp_J-pOf5IWHcuk1wc.js?m8nmll"></script>
<script type="text/javascript" src="http://localhost/EventMust/modules/toolbar/toolbar.js?m8nmll"></script>
<script type="text/javascript" src="http://localhost/EventMust/sites/all/themes/omega/omega/js/jquery.formalize.js?m8nmll"></script>
<script type="text/javascript" src="http://localhost/EventMust/sites/all/themes/omega/omega/js/omega-mediaqueries.js?m8nmll"></script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
jQuery.extend(Drupal.settings, {"basePath":"\/EventMust\/","pathPrefix":"","ajaxPageState":{"theme":"omega","theme_token":"QVlgBYsyZM3ONS7s1tLwhgpFIG1BD7LdWh5pP4O1J-8","js":{"misc\/jquery.js":1,"misc\/jquery.once.js":1,"misc\/drupal.js":1,"modules\/contextual\/contextual.js":1,"misc\/jquery.cookie.js":1,"public:\/\/languages\/fr_JQ3DR68lWFNdYdiBl5wvoJJA9jp_J-pOf5IWHcuk1wc.js":1,"modules\/toolbar\/toolbar.js":1,"sites\/all\/themes\/omega\/omega\/js\/jquery.formalize.js":1,"sites\/all\/themes\/omega\/omega\/js\/omega-mediaqueries.js":1},"css":{"modules\/system\/system.base.css":1,"modules\/system\/system.menus.css":1,"modules\/system\/system.messages.css":1,"modules\/system\/system.theme.css":1,"modules\/contextual\/contextual.css":1,"modules\/comment\/comment.css":1,"sites\/all\/modules\/date\/date_api\/date.css":1,"sites\/all\/modules\/date\/date_popup\/themes\/datepicker.1.7.css":1,"modules\/field\/theme\/field.css":1,"sites\/all\/modules\/myfollow\/myfollow.css":1,"modules\/node\/node.css":1,"modules\/search\/search.css":1,"modules\/user\/user.css":1,"sites\/all\/modules\/ctools\/css\/ctools.css":1,"sites\/all\/modules\/localizer\/css\/localizer.css":1,"modules\/shortcut\/shortcut.css":1,"modules\/toolbar\/toolbar.css":1,"sites\/all\/themes\/omega\/alpha\/css\/alpha-reset.css":1,"sites\/all\/themes\/omega\/alpha\/css\/alpha-mobile.css":1,"sites\/all\/themes\/omega\/alpha\/css\/alpha-alpha.css":1,"sites\/all\/themes\/omega\/omega\/css\/formalize.css":1,"sites\/all\/themes\/omega\/omega\/css\/omega-text.css":1,"sites\/all\/themes\/omega\/omega\/css\/omega-branding.css":1,"sites\/all\/themes\/omega\/omega\/css\/omega-menu.css":1,"sites\/all\/themes\/omega\/omega\/css\/omega-forms.css":1,"sites\/all\/themes\/omega\/omega\/css\/omega-visuals.css":1,"ie::normal::sites\/all\/themes\/omega\/alpha\/css\/grid\/alpha_default\/normal\/alpha-default-normal-12.css":1,"sites\/all\/themes\/omega\/alpha\/css\/grid\/alpha_default\/narrow\/alpha-default-narrow-12.css":1,"sites\/all\/themes\/omega\/alpha\/css\/grid\/alpha_default\/normal\/alpha-default-normal-12.css":1,"sites\/all\/themes\/omega\/alpha\/css\/grid\/alpha_default\/wide\/alpha-default-wide-12.css":1}},"omega":{"layouts":{"primary":"normal","order":["narrow","normal","wide"],"queries":{"narrow":"all and (min-width: 740px) and (min-device-width: 740px), (max-device-width: 800px) and (min-width: 740px) and (orientation:landscape)","normal":"all and (min-width: 980px) and (min-device-width: 980px), all and (max-device-width: 1024px) and (min-width: 1024px) and (orientation:landscape)","wide":"all and (min-width: 1220px)"}}},"tableHeaderOffset":"Drupal.toolbar.height"});
//--><!]]>
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-32673791-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
</head>
<body class="html not-front logged-in page-migrate page-migrate-account toolbar context-migrate">
<div id="skip-link">
<a href="#main-content" class="element-invisible element-focusable">Aller au contenu principal</a>
</div>
<div class="region region-page-top" id="region-page-top">
<div class="region-inner region-page-top-inner">
<div id="toolbar" class="toolbar overlay-displace-top clearfix">
<div class="toolbar-menu clearfix">
<ul id="toolbar-home"><li class="home first last"><a href="/EventMust/" title="Accueil"><span class="home-link">Home</span></a></li></ul> <ul id="toolbar-user"><li class="account first"><a href="/EventMust/user" title="Compte utilisateur">Bonjour <strong>admin</strong></a></li><li class="logout last"><a href="/EventMust/user/logout">Se déconnecter</a></li></ul> <h2 class="element-invisible">Barre d'outils d'administration</h2><ul id="toolbar-menu"><li class="menu-11 path-admin-dashboard first"><a href="/EventMust/admin/dashboard" id="toolbar-link-admin-dashboard" title="Voir et personnaliser votre tableau de bord."><span class="icon"></span>Tableau de bord <span class="element-invisible">(Voir et personnaliser votre tableau de bord.)</span></a></li><li class="menu-9 path-admin-content"><a href="/EventMust/admin/content" id="toolbar-link-admin-content" title="Administrer le contenu et les commentaires."><span class="icon"></span>Contenu <span class="element-invisible">(Administrer le contenu et les commentaires.)</span></a></li><li class="menu-21 path-admin-structure"><a href="/EventMust/admin/structure" id="toolbar-link-admin-structure" title="Administrer les blocs, les types de contenu, les menus, etc."><span class="icon"></span>Structure <span class="element-invisible">(Administrer les blocs, les types de contenu, les menus, etc.)</span></a></li><li class="menu-7 path-admin-appearance"><a href="/EventMust/admin/appearance" id="toolbar-link-admin-appearance" title="Choisir et configurer vos thèmes."><span class="icon"></span>Apparence <span class="element-invisible">(Choisir et configurer vos thèmes.)</span></a></li><li class="menu-18 path-admin-people"><a href="/EventMust/admin/people" id="toolbar-link-admin-people" title="Gérer les comptes utilisateurs, les rôles et les droits."><span class="icon"></span>Personnes <span class="element-invisible">(Gérer les comptes utilisateurs, les rôles et les droits.)</span></a></li><li class="menu-16 path-admin-modules"><a href="/EventMust/admin/modules" id="toolbar-link-admin-modules" title="Étendre les fonctionnalités."><span class="icon"></span>Modules <span class="element-invisible">(Étendre les fonctionnalités.)</span></a></li><li class="menu-8 path-admin-config"><a href="/EventMust/admin/config" id="toolbar-link-admin-config" title="Administrer les paramètres."><span class="icon"></span>Configuration <span class="element-invisible">(Administrer les paramètres.)</span></a></li><li class="menu-19 path-admin-reports"><a href="/EventMust/admin/reports" id="toolbar-link-admin-reports" title="Voir les rapports, les mises à jour et les erreurs."><span class="icon"></span>Rapports <span class="element-invisible">(Voir les rapports, les mises à jour et les erreurs.)</span></a></li><li class="menu-12 path-admin-help last"><a href="/EventMust/admin/help" id="toolbar-link-admin-help" title="Référence pour l'utilisation, la configuration et les modules."><span class="icon"></span>Aide <span class="element-invisible">(Référence pour l'utilisation, la configuration et les modules.)</span></a></li></ul> <a href="/EventMust/toolbar/toggle?destination=migrate/account" title="Afficher les raccourcis" class="toggle">Afficher les raccourcis</a> </div>
<div class="toolbar-drawer clearfix collapsed">
<div class="toolbar-shortcuts"><ul class="menu"><li class="first leaf"><a href="/EventMust/node/add">Ajouter du contenu</a></li>
<li class="leaf"><a href="/EventMust/admin/content">Rechercher des contenus</a></li>
<li class="last leaf"><a href="/EventMust/admin/structure/taxonomy/cat_gorie">Ajouter une catégorie</a></li>
</ul></div><a href="/EventMust/admin/config/user-interface/shortcut/shortcut-set-1" id="edit-shortcuts">Modifier les raccourcis</a> </div>
</div>
</div>
</div> <div class="page clearfix" id="page">
<header id="section-header" class="section section-header">
<div id="zone-header-wrapper" class="zone-wrapper zone-header-wrapper clearfix">
<div id="zone-header" class="zone zone-header clearfix container-12">
<div class="grid-12 region region-header" id="region-header">
<div class="region-inner region-header-inner">
<section class="block block-counter contextual-links-region block-counter-home block-counter-counter-home odd" id="block-counter-counter-home">
<div class="block-inner clearfix">
<h2 class="block-title">Counter d'annonces</h2>
<div class="contextual-links-wrapper"><ul class="contextual-links"><li class="block-configure first last"><a href="/EventMust/admin/structure/block/manage/counter/counter_home/configure?destination=migrate/account">Configurer le bloc</a></li></ul></div>
<div class="content clearfix">
<p>Actuellement 4 annonces en ligne. </div>
</div>
</section> </div>
</div> </div>
</div><div id="zone-menu-wrapper" class="zone-wrapper zone-menu-wrapper clearfix">
<div id="zone-menu" class="zone zone-menu clearfix container-12">
<div class="grid-12 region region-menu" id="region-menu">
<div class="region-inner region-menu-inner">
<nav class="navigation">
<h2 class="element-invisible">Menu principal</h2><ul id="main-menu" class="links inline clearfix main-menu"><li class="menu-237 first"><a href="/EventMust/">Accueil</a></li><li class="menu-381"><a href="/EventMust/espace_annonceur" title="">Espace annonceur</a></li><li class="menu-382"><a href="/EventMust/mon-eventmust" title="">Mon eventmust</a></li><li class="menu-383"><a href="/EventMust/" title="">Presse</a></li><li class="menu-384 last"><a href="/EventMust/" title="">Contact</a></li></ul> <h2 class="element-invisible">Menu secondaire</h2><ul id="secondary-menu" class="links inline clearfix secondary-menu"><li class="menu-2 first"><a href="/EventMust/user">Mon compte</a></li><li class="menu-15 last"><a href="/EventMust/user/logout">Se déconnecter</a></li></ul> </nav>
</div>
</div>
</div>
</div></header>
<section id="section-content" class="section section-content">
<div id="zone-content-wrapper" class="zone-wrapper zone-content-wrapper clearfix">
<div id="zone-content" class="zone zone-content clearfix container-12">
<div id="breadcrumb" class="grid-12"><h2 class="element-invisible">Vous êtes ici</h2><div class="breadcrumb"><a href="/EventMust/">Accueil</a></div></div>
<div class="grid-12 region region-content" id="region-content">
<div class="region-inner region-content-inner">
<a id="main-content"></a>
<h1 class="title" id="page-title">Migration du type de compte</h1>
<div class="block block-system block-main block-system-main odd block-without-title" id="block-system-main">
<div class="block-inner clearfix">
<div class="content clearfix">
<div class="form-item form-type-select">
<label>Choisissez votre nouveau type de compte </label>
<select class="form-select"><option value="4">annonceur</option><option value="6">annonceur premium</option><option value="5">modérateur</option></select>
<div class="description">Vous devez choisir vers quel type de compte migrer.</div>
</div>
<input type="submit" name="op" value="Submit" class="form-submit" /> </div>
</div>
</div> </div>
</div> </div>
</div></section>
</div> </body>
</html>
Non justement, il n’y a aucun
Permalien Soumis par GSAnthony le 13 Août, 2012 - 13:40
Non justement, il n'y a aucun rechargement de la page. Je te donne quand même le code source de la page :
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML+RDFa 1.1//EN">
<html lang="fr" dir="ltr" version="HTML+RDFa 1.1"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/terms/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:og="http://ogp.me/ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:sioc="http://rdfs.org/sioc/ns#"
xmlns:sioct="http://rdfs.org/sioc/types#"
xmlns:skos="http://www.w3.org/2004/02/skos/core#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#">
<head profile="http://www.w3.org/1999/xhtml/vocab">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
<meta name="Generator" content="Drupal 7 (http://drupal.org)" />
<link rel="shortcut icon" href="http://localhost/EventMust/misc/favicon.ico" type="image/vnd.microsoft.icon" />
<title>Migration du type de compte | Event Must</title>
<style type="text/css" media="all">@import url("http://localhost/EventMust/modules/system/system.base.css?m8nmll");
@import url("http://localhost/EventMust/modules/system/system.menus.css?m8nmll");
@import url("http://localhost/EventMust/modules/system/system.messages.css?m8nmll");
@import url("http://localhost/EventMust/modules/system/system.theme.css?m8nmll");</style>
<style type="text/css" media="all">@import url("http://localhost/EventMust/modules/contextual/contextual.css?m8nmll");</style>
<style type="text/css" media="all">@import url("http://localhost/EventMust/modules/comment/comment.css?m8nmll");
@import url("http://localhost/EventMust/sites/all/modules/date/date_api/date.css?m8nmll");
@import url("http://localhost/EventMust/sites/all/modules/date/date_popup/themes/datepicker.1.7.css?m8nmll");
@import url("http://localhost/EventMust/modules/field/theme/field.css?m8nmll");
@import url("http://localhost/EventMust/sites/all/modules/myfollow/myfollow.css?m8nmll");
@import url("http://localhost/EventMust/modules/node/node.css?m8nmll");
@import url("http://localhost/EventMust/modules/search/search.css?m8nmll");
@import url("http://localhost/EventMust/modules/user/user.css?m8nmll");</style>
<style type="text/css" media="all">@import url("http://localhost/EventMust/sites/all/modules/ctools/css/ctools.css?m8nmll");
@import url("http://localhost/EventMust/modules/shortcut/shortcut.css?m8nmll");
@import url("http://localhost/EventMust/modules/toolbar/toolbar.css?m8nmll");</style>
<style type="text/css" media="all">@import url("http://localhost/EventMust/sites/all/themes/omega/alpha/css/alpha-reset.css?m8nmll");
@import url("http://localhost/EventMust/sites/all/themes/omega/alpha/css/alpha-mobile.css?m8nmll");
@import url("http://localhost/EventMust/sites/all/themes/omega/alpha/css/alpha-alpha.css?m8nmll");
@import url("http://localhost/EventMust/sites/all/themes/omega/omega/css/formalize.css?m8nmll");
@import url("http://localhost/EventMust/sites/all/themes/omega/omega/css/omega-text.css?m8nmll");
@import url("http://localhost/EventMust/sites/all/themes/omega/omega/css/omega-branding.css?m8nmll");
@import url("http://localhost/EventMust/sites/all/themes/omega/omega/css/omega-menu.css?m8nmll");
@import url("http://localhost/EventMust/sites/all/themes/omega/omega/css/omega-forms.css?m8nmll");
@import url("http://localhost/EventMust/sites/all/themes/omega/omega/css/omega-visuals.css?m8nmll");</style>
<!--[if (lt IE 9)&(!IEMobile)]>
<style type="text/css" media="all">@import url("http://localhost/EventMust/sites/all/themes/omega/alpha/css/grid/alpha_default/normal/alpha-default-normal-12.css?m8nmll");</style>
<![endif]-->
<!--[if gte IE 9]><!-->
<style type="text/css" media="all and (min-width: 740px) and (min-device-width: 740px), (max-device-width: 800px) and (min-width: 740px) and (orientation:landscape)">@import url("http://localhost/EventMust/sites/all/themes/omega/alpha/css/grid/alpha_default/narrow/alpha-default-narrow-12.css?m8nmll");</style>
<!--<![endif]-->
<!--[if gte IE 9]><!-->
<style type="text/css" media="all and (min-width: 980px) and (min-device-width: 980px), all and (max-device-width: 1024px) and (min-width: 1024px) and (orientation:landscape)">@import url("http://localhost/EventMust/sites/all/themes/omega/alpha/css/grid/alpha_default/normal/alpha-default-normal-12.css?m8nmll");</style>
<!--<![endif]-->
<!--[if gte IE 9]><!-->
<style type="text/css" media="all and (min-width: 1220px)">@import url("http://localhost/EventMust/sites/all/themes/omega/alpha/css/grid/alpha_default/wide/alpha-default-wide-12.css?m8nmll");</style>
<!--<![endif]-->
<script type="text/javascript" src="http://localhost/EventMust/misc/jquery.js?v=1.4.4"></script>
<script type="text/javascript" src="http://localhost/EventMust/misc/jquery.once.js?v=1.2"></script>
<script type="text/javascript" src="http://localhost/EventMust/misc/drupal.js?m8nmll"></script>
<script type="text/javascript" src="http://localhost/EventMust/modules/contextual/contextual.js?v=1.0"></script>
<script type="text/javascript" src="http://localhost/EventMust/misc/jquery.cookie.js?v=1.0"></script>
<script type="text/javascript" src="http://localhost/EventMust/sites/default/files/languages/fr_JQ3DR68lWFNdYdiBl5wvoJJA9jp_J-pOf5IWHcuk1wc.js?m8nmll"></script>
<script type="text/javascript" src="http://localhost/EventMust/modules/toolbar/toolbar.js?m8nmll"></script>
<script type="text/javascript" src="http://localhost/EventMust/sites/all/themes/omega/omega/js/jquery.formalize.js?m8nmll"></script>
<script type="text/javascript" src="http://localhost/EventMust/sites/all/themes/omega/omega/js/omega-mediaqueries.js?m8nmll"></script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
jQuery.extend(Drupal.settings, {"basePath":"\/EventMust\/","pathPrefix":"","ajaxPageState":{"theme":"omega","theme_token":"QVlgBYsyZM3ONS7s1tLwhgpFIG1BD7LdWh5pP4O1J-8","js":{"misc\/jquery.js":1,"misc\/jquery.once.js":1,"misc\/drupal.js":1,"modules\/contextual\/contextual.js":1,"misc\/jquery.cookie.js":1,"public:\/\/languages\/fr_JQ3DR68lWFNdYdiBl5wvoJJA9jp_J-pOf5IWHcuk1wc.js":1,"modules\/toolbar\/toolbar.js":1,"sites\/all\/themes\/omega\/omega\/js\/jquery.formalize.js":1,"sites\/all\/themes\/omega\/omega\/js\/omega-mediaqueries.js":1},"css":{"modules\/system\/system.base.css":1,"modules\/system\/system.menus.css":1,"modules\/system\/system.messages.css":1,"modules\/system\/system.theme.css":1,"modules\/contextual\/contextual.css":1,"modules\/comment\/comment.css":1,"sites\/all\/modules\/date\/date_api\/date.css":1,"sites\/all\/modules\/date\/date_popup\/themes\/datepicker.1.7.css":1,"modules\/field\/theme\/field.css":1,"sites\/all\/modules\/myfollow\/myfollow.css":1,"modules\/node\/node.css":1,"modules\/search\/search.css":1,"modules\/user\/user.css":1,"sites\/all\/modules\/ctools\/css\/ctools.css":1,"sites\/all\/modules\/localizer\/css\/localizer.css":1,"modules\/shortcut\/shortcut.css":1,"modules\/toolbar\/toolbar.css":1,"sites\/all\/themes\/omega\/alpha\/css\/alpha-reset.css":1,"sites\/all\/themes\/omega\/alpha\/css\/alpha-mobile.css":1,"sites\/all\/themes\/omega\/alpha\/css\/alpha-alpha.css":1,"sites\/all\/themes\/omega\/omega\/css\/formalize.css":1,"sites\/all\/themes\/omega\/omega\/css\/omega-text.css":1,"sites\/all\/themes\/omega\/omega\/css\/omega-branding.css":1,"sites\/all\/themes\/omega\/omega\/css\/omega-menu.css":1,"sites\/all\/themes\/omega\/omega\/css\/omega-forms.css":1,"sites\/all\/themes\/omega\/omega\/css\/omega-visuals.css":1,"ie::normal::sites\/all\/themes\/omega\/alpha\/css\/grid\/alpha_default\/normal\/alpha-default-normal-12.css":1,"sites\/all\/themes\/omega\/alpha\/css\/grid\/alpha_default\/narrow\/alpha-default-narrow-12.css":1,"sites\/all\/themes\/omega\/alpha\/css\/grid\/alpha_default\/normal\/alpha-default-normal-12.css":1,"sites\/all\/themes\/omega\/alpha\/css\/grid\/alpha_default\/wide\/alpha-default-wide-12.css":1}},"omega":{"layouts":{"primary":"normal","order":["narrow","normal","wide"],"queries":{"narrow":"all and (min-width: 740px) and (min-device-width: 740px), (max-device-width: 800px) and (min-width: 740px) and (orientation:landscape)","normal":"all and (min-width: 980px) and (min-device-width: 980px), all and (max-device-width: 1024px) and (min-width: 1024px) and (orientation:landscape)","wide":"all and (min-width: 1220px)"}}},"tableHeaderOffset":"Drupal.toolbar.height"});
//--><!]]>
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-32673791-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
</head>
<body class="html not-front logged-in page-migrate page-migrate-account toolbar context-migrate">
<div id="skip-link">
<a href="#main-content" class="element-invisible element-focusable">Aller au contenu principal</a>
</div>
<div class="region region-page-top" id="region-page-top">
<div class="region-inner region-page-top-inner">
<div id="toolbar" class="toolbar overlay-displace-top clearfix">
<div class="toolbar-menu clearfix">
<ul id="toolbar-home"><li class="home first last"><a href="/EventMust/" title="Accueil"><span class="home-link">Home</span></a></li></ul> <ul id="toolbar-user"><li class="account first"><a href="/EventMust/user" title="Compte utilisateur">Bonjour <strong>admin</strong></a></li><li class="logout last"><a href="/EventMust/user/logout">Se déconnecter</a></li></ul> <h2 class="element-invisible">Barre d'outils d'administration</h2><ul id="toolbar-menu"><li class="menu-11 path-admin-dashboard first"><a href="/EventMust/admin/dashboard" id="toolbar-link-admin-dashboard" title="Voir et personnaliser votre tableau de bord."><span class="icon"></span>Tableau de bord <span class="element-invisible">(Voir et personnaliser votre tableau de bord.)</span></a></li><li class="menu-9 path-admin-content"><a href="/EventMust/admin/content" id="toolbar-link-admin-content" title="Administrer le contenu et les commentaires."><span class="icon"></span>Contenu <span class="element-invisible">(Administrer le contenu et les commentaires.)</span></a></li><li class="menu-21 path-admin-structure"><a href="/EventMust/admin/structure" id="toolbar-link-admin-structure" title="Administrer les blocs, les types de contenu, les menus, etc."><span class="icon"></span>Structure <span class="element-invisible">(Administrer les blocs, les types de contenu, les menus, etc.)</span></a></li><li class="menu-7 path-admin-appearance"><a href="/EventMust/admin/appearance" id="toolbar-link-admin-appearance" title="Choisir et configurer vos thèmes."><span class="icon"></span>Apparence <span class="element-invisible">(Choisir et configurer vos thèmes.)</span></a></li><li class="menu-18 path-admin-people"><a href="/EventMust/admin/people" id="toolbar-link-admin-people" title="Gérer les comptes utilisateurs, les rôles et les droits."><span class="icon"></span>Personnes <span class="element-invisible">(Gérer les comptes utilisateurs, les rôles et les droits.)</span></a></li><li class="menu-16 path-admin-modules"><a href="/EventMust/admin/modules" id="toolbar-link-admin-modules" title="Étendre les fonctionnalités."><span class="icon"></span>Modules <span class="element-invisible">(Étendre les fonctionnalités.)</span></a></li><li class="menu-8 path-admin-config"><a href="/EventMust/admin/config" id="toolbar-link-admin-config" title="Administrer les paramètres."><span class="icon"></span>Configuration <span class="element-invisible">(Administrer les paramètres.)</span></a></li><li class="menu-19 path-admin-reports"><a href="/EventMust/admin/reports" id="toolbar-link-admin-reports" title="Voir les rapports, les mises à jour et les erreurs."><span class="icon"></span>Rapports <span class="element-invisible">(Voir les rapports, les mises à jour et les erreurs.)</span></a></li><li class="menu-12 path-admin-help last"><a href="/EventMust/admin/help" id="toolbar-link-admin-help" title="Référence pour l'utilisation, la configuration et les modules."><span class="icon"></span>Aide <span class="element-invisible">(Référence pour l'utilisation, la configuration et les modules.)</span></a></li></ul> <a href="/EventMust/toolbar/toggle?destination=migrate/account" title="Afficher les raccourcis" class="toggle">Afficher les raccourcis</a> </div>
<div class="toolbar-drawer clearfix collapsed">
<div class="toolbar-shortcuts"><ul class="menu"><li class="first leaf"><a href="/EventMust/node/add">Ajouter du contenu</a></li>
<li class="leaf"><a href="/EventMust/admin/content">Rechercher des contenus</a></li>
<li class="last leaf"><a href="/EventMust/admin/structure/taxonomy/cat_gorie">Ajouter une catégorie</a></li>
</ul></div><a href="/EventMust/admin/config/user-interface/shortcut/shortcut-set-1" id="edit-shortcuts">Modifier les raccourcis</a> </div>
</div>
</div>
</div> <div class="page clearfix" id="page">
<header id="section-header" class="section section-header">
<div id="zone-header-wrapper" class="zone-wrapper zone-header-wrapper clearfix">
<div id="zone-header" class="zone zone-header clearfix container-12">
<div class="grid-12 region region-header" id="region-header">
<div class="region-inner region-header-inner">
<section class="block block-counter contextual-links-region block-counter-home block-counter-counter-home odd" id="block-counter-counter-home">
<div class="block-inner clearfix">
<h2 class="block-title">Counter d'annonces</h2>
<div class="contextual-links-wrapper"><ul class="contextual-links"><li class="block-configure first last"><a href="/EventMust/admin/structure/block/manage/counter/counter_home/configure?destination=migrate/account">Configurer le bloc</a></li></ul></div>
<div class="content clearfix">
<p>Actuellement 4 annonces en ligne. </div>
</div>
</section> </div>
</div> </div>
</div><div id="zone-menu-wrapper" class="zone-wrapper zone-menu-wrapper clearfix">
<div id="zone-menu" class="zone zone-menu clearfix container-12">
<div class="grid-12 region region-menu" id="region-menu">
<div class="region-inner region-menu-inner">
<nav class="navigation">
<h2 class="element-invisible">Menu principal</h2><ul id="main-menu" class="links inline clearfix main-menu"><li class="menu-237 first"><a href="/EventMust/">Accueil</a></li><li class="menu-381"><a href="/EventMust/espace_annonceur" title="">Espace annonceur</a></li><li class="menu-382"><a href="/EventMust/mon-eventmust" title="">Mon eventmust</a></li><li class="menu-383"><a href="/EventMust/" title="">Presse</a></li><li class="menu-384 last"><a href="/EventMust/" title="">Contact</a></li></ul> <h2 class="element-invisible">Menu secondaire</h2><ul id="secondary-menu" class="links inline clearfix secondary-menu"><li class="menu-2 first"><a href="/EventMust/user">Mon compte</a></li><li class="menu-15 last"><a href="/EventMust/user/logout">Se déconnecter</a></li></ul> </nav>
</div>
</div>
</div>
</div></header>
<section id="section-content" class="section section-content">
<div id="zone-content-wrapper" class="zone-wrapper zone-content-wrapper clearfix">
<div id="zone-content" class="zone zone-content clearfix container-12">
<div id="breadcrumb" class="grid-12"><h2 class="element-invisible">Vous êtes ici</h2><div class="breadcrumb"><a href="/EventMust/">Accueil</a></div></div>
<div class="grid-12 region region-content" id="region-content">
<div class="region-inner region-content-inner">
<a id="main-content"></a>
<h1 class="title" id="page-title">Migration du type de compte</h1>
<div class="block block-system block-main block-system-main odd block-without-title" id="block-system-main">
<div class="block-inner clearfix">
<div class="content clearfix">
<div class="form-item form-type-select">
<label>Choisissez votre nouveau type de compte </label>
<select class="form-select"><option value="4">annonceur</option><option value="6">annonceur premium</option><option value="5">modérateur</option></select>
<div class="description">Vous devez choisir vers quel type de compte migrer.</div>
</div>
<input type="submit" name="op" value="Submit" class="form-submit" /> </div>
</div>
</div> </div>
</div> </div>
</div></section>
</div> </body>
</html>
Re, J’ai regardé vite fait
Permalien Soumis par NetOctet le 13 Août, 2012 - 23:18
Re,
J'ai regardé vite fait ton code. Tu as confondu deux ou trois trucs.
La fonction que tu appelles comme callback dans ton menu, c'est une fonction qui doit retourner le résultat à afficher. Or, tu appelles la fonction qui crée un formulaire...
En regardant le code source renvoyé par ta page, tu remarqueras que le formulaire n'a même pas été écrit. (Absence de
<
form>, c'est pour ça que le submit ne submit pas).
Ton callback doit appeler une fonction du genre :
function migrate_account_migration()
{
$content = drupal_get_form('migrate_account_migration_form');
return $content;
}
Essaye comme ça, ça devrait mieux marcher normalement.
Tiens-nous au courant. :)
Je vais essayer ça. Merci
Permalien Soumis par GSAnthony le 18 Août, 2012 - 17:32
Je vais essayer ça. Merci
N’hésite pas à me tenir au
Permalien Soumis par NetOctet le 21 Août, 2012 - 10:07
N'hésite pas à me tenir au courant, si ça marche. ;)
Au moins pour ma satisfaction personnelle !
Effectivement j’ai encore
Permalien Soumis par GSAnthony le 21 Août, 2012 - 17:57
Effectivement j'ai encore besoin de ton aide, car ce que tu m'as dit de faire fonctionne mais je n'arrive pas à faire apparaître $form_state pour récupérer la valeur choisie dans le formulaire. Le var_dump me servirait à voir la structure de $form_state.
function migrate_account_migration_form_submit($form, &$form_state) {
var_dump($form_state);
}
Merci d'avance de ta réponse.
Si ton var_dumpt fonctionne,
Permalien Soumis par NetOctet le 22 Août, 2012 - 23:47
Si ton var_dumpt fonctionne, je ne comprends pas ton problème ! Tu vois bien la variable s'afficher lors du submit de ta page ?
Donc, tu récupères les informations qui t'intéressent à ce moment-là, puis tu la traites comme tu voulais la traiter... Je ne vois pas trop le souci.
Je ne sais pas trop, je ne
Permalien Soumis par GSAnthony le 23 Août, 2012 - 15:39
Je ne sais pas trop, je ne vois rien s'afficher à mon écran... Je te montres l'ensemble de mon code :
<?php
/
* Implementation of hook_permission().
*/
function migrate_account_permission() {
return array(
'access migrate_account' => array(
'title' => 'Autorise la possibilité de migrer de type de compte',
'description' => '',
),
);
}
/
* Implements hook_menu().
*/
function migrate_account_menu() {
$items['migrate/account'] = array(
'title' => 'Migration du type de compte',
'page callback' => 'migrate_account_migration',
'access arguments' => array('access migrate_account'),
'type' => MENU_CALLBACK,
);
return $items;
}
function migrate_account_migration()
{
$content = drupal_get_form('migrate_account_migration_form');
return $content ;
}
function migrate_account_migration_form($form, &$form_state) {
global $user;
$own = $user->uid;
$option = array();
$result = db_query("SELECT rid, name FROM {role} WHERE rid!=3 AND rid!=2 AND rid!=1");
foreach ($result as $record) {
$option[$record->rid] = $record->name;
}
$form['account'] = array(
'#type' => 'select',
'#title' => t('Choisissez votre nouveau type de compte'),
'#options' => $option,
'#default_value' => '',
'#description' => t('Vous devez choisir vers quel type de compte migrer.'),
);
$form['cancel']['#prefix'] = '<input class="event-node-cancel" type="button" value="Cancel" onClick="history.go(-1)"/>';r
$form['submit'] = array('#type' => 'submit', '#value' => t('Submit'));
return $form;
}
function migrate_account_migration_form_submit($form, &$form_state) {
var_dump($form_state);
}
Tu n’as pas une URL où je
Permalien Soumis par NetOctet le 23 Août, 2012 - 19:05
Tu n'as pas une URL où je pourrais tester ?
Parce que c'est dur de comprendre ce qui marche et ne marche pas là. Ton SUBMIT il marche ? Et sur la page où on atterrit, tu n'as rien, même avec le var_dump ? Tu as tenté un echo "
Test
"; sur ta fonction submit pour voir si ça affichait ?
Non je suis désolé je n’ai
Permalien Soumis par GSAnthony le 23 Août, 2012 - 19:20
Non je suis désolé je n'ai pas de lien pour te faire tester. Mais j'ai essayé avec un echo "string"; et un drupal_set_message('test'); et seul le message "test" s'affiche. Quand je clique sur le bouton Submit, j'ai bien un rechargement de la page.
Si le drupal_set_message
Permalien Soumis par NetOctet le 23 Août, 2012 - 19:24
Si le drupal_set_message marche, je vois pas pourquoi les autres ne marcheraient pas. Ils s'affichent forcément (au moins dans le code source...).
Au pire, mets exit(); après ton var_dump.
Ah ça marche ! Merci
Permalien Soumis par GSAnthony le 23 Août, 2012 - 19:33
Ah ça marche ! Merci beaucoup.