Précédent   Forum des professionnels en informatique > PHP > Outils > Zend > Zend Framework
Zend Framework Forum d'entraide sur la programmation PHP avec Zend Framework. Avant de poster -> FAQ ZF, Cours ZF
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 12/01/2012, 19h50   #1
Invité de passage
 
Inscription : juillet 2005
Messages : 8
Détails du profil
Informations personnelles :
Âge : 30

Informations forums :
Inscription : juillet 2005
Messages : 8
Points : 2
Points : 2
Par défaut [Zend_Date] No date part in '' found

Bonjour,

J'ai un souci sur le index.phtml ou il m'affiche No date part in '' found. le souci est que j'ai cette erreur en ligne et non en local alors que ma base mysql est la meme et que le code aussi.

Il y aurai t il des souci connu par rapport aux hebergeurs? (Je suis chez ovh).
J'ai essayé de chercher a différents endroits mais en vain. J'ai bien conscience que mon explication est très succinte mais je suis vraiment dans une impasse.

D'avance merci
Flyin_arno est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 12/01/2012, 20h23   #2
Modérateur
 
Homme Loïc
Développeur Web
Inscription : février 2011
Messages : 680
Détails du profil
Informations personnelles :
Nom : Homme Loïc
Âge : 26
Localisation : France, Hérault (Languedoc Roussillon)

Informations professionnelles :
Activité : Développeur Web
Secteur : High Tech - Multimédia et Internet

Informations forums :
Inscription : février 2011
Messages : 680
Points : 1 044
Points : 1 044
Bonsoir,
Montre nous le code générant cette erreur, ça sera plus pratique pour t'aider
5h4rk est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 13/01/2012, 11h24   #3
Invité de passage
 
Inscription : juillet 2005
Messages : 8
Détails du profil
Informations personnelles :
Âge : 30

Informations forums :
Inscription : juillet 2005
Messages : 8
Points : 2
Points : 2
Comme je n'arrive pas a reproduire le probleme en local je ne sais pas trop d'ou vient l'erreur j'ai ça comme erreur:
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
An error occurred
Application error
Exception information:
 
Message: No date part in '' found.
Stack trace:
 
#0 /homez.461/lassocia/www/backoffice/library/Zend/Date.php(1078): Zend_Date->_calculate('set', false, NULL, 'en_US')
#1 /homez.461/lassocia/www/backoffice/library/Zend/Date.php(197): Zend_Date->set(false, NULL, 'en_US')
#2 /homez.461/lassocia/www/backoffice/application/models/CommandeFilter.php(48): Zend_Date->__construct(false)
#3 /homez.461/lassocia/www/backoffice/library/Zend/Paginator.php(789): Application_Model_CommandeFilter->filter(Object(Zend_Db_Table_Rowset))
#4 /homez.461/lassocia/www/backoffice/library/Zend/Paginator.php(613): Zend_Paginator->getItemsByPage(1)
#5 /homez.461/lassocia/www/backoffice/library/Zend/Paginator.php(810): Zend_Paginator->getCurrentItems()
#6 /homez.461/lassocia/www/backoffice/application/views/scripts/commande/index.phtml(35): Zend_Paginator->getIterator()
#7 /homez.461/lassocia/www/backoffice/library/Zend/View.php(108): include('/homez.461/lass...')
#8 /homez.461/lassocia/www/backoffice/library/Zend/View/Abstract.php(880): Zend_View->_run('/homez.461/lass...')
#9 /homez.461/lassocia/www/backoffice/library/Zend/Controller/Action/Helper/ViewRenderer.php(897): Zend_View_Abstract->render('commande/index....')
#10 /homez.461/lassocia/www/backoffice/library/Zend/Controller/Action/Helper/ViewRenderer.php(918): Zend_Controller_Action_Helper_ViewRenderer->renderScript('commande/index....', NULL)
#11 /homez.461/lassocia/www/backoffice/library/Zend/Controller/Action/Helper/ViewRenderer.php(957): Zend_Controller_Action_Helper_ViewRenderer->render()
#12 /homez.461/lassocia/www/backoffice/library/Zend/Controller/Action/HelperBroker.php(277): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#13 /homez.461/lassocia/www/backoffice/library/Zend/Controller/Action.php(523): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#14 /homez.461/lassocia/www/backoffice/library/Zend/Controller/Dispatcher/Standard.php(295): Zend_Controller_Action->dispatch('indexAction')
#15 /homez.461/lassocia/www/backoffice/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#16 /homez.461/lassocia/www/backoffice/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#17 /homez.461/lassocia/www/backoffice/application/Bootstrap.php(39): Zend_Application_Bootstrap_Bootstrap->run()
#18 /homez.461/lassocia/www/backoffice/library/Zend/Application.php(366): Bootstrap->run()
#19 /homez.461/lassocia/www/backoffice/public/index.php(26): Zend_Application->run()
#20 {main}  
 
Request Parameters:
 
array (
  'controller' => 'commande',
  'action' => 'index',
  'module' => 'default',
)
Flyin_arno est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 13/01/2012, 11h40   #4
Membre actif
 
Homme Ahmed Benlahsen
Ingenieur BI - Dev Web Senior
Inscription : décembre 2009
Messages : 118
Détails du profil
Informations personnelles :
Nom : Homme Ahmed Benlahsen
Localisation : Maroc

Informations professionnelles :
Activité : Ingenieur BI - Dev Web Senior

Informations forums :
Inscription : décembre 2009
Messages : 118
Points : 157
Points : 157
Envoyer un message via MSN à abenlahsen Envoyer un message via Skype™ à abenlahsen
Salut,

Montre la ligne 48 de ton model CommandeFilter ? Et la fonction aussi
abenlahsen est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 13/01/2012, 11h53   #5
Invité de passage
 
Inscription : juillet 2005
Messages : 8
Détails du profil
Informations personnelles :
Âge : 30

Informations forums :
Inscription : juillet 2005
Messages : 8
Points : 2
Points : 2
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
public function filter($resultSet, $options=null) {
		$entries = array(); 
		$statusDao = new Application_Model_CommandeStatusMapper();
		$compteDao = new Application_Model_CompteMapper();
		$commandeLineDao = new Application_Model_CommandeLineMapper();
        foreach ($resultSet as $row) {
            $entry = new Application_Model_Commande();
            $entry->setId($row["ID_COMMANDE"]);
            if ($row["COMMANDE_DATE"] != null) {
	            $date = new Zend_Date();
	    		$date->set($row["COMMANDE_DATE"],'yyyy-MM-dd hh:mm:ss');
	            $entry->setDate($date);
            }
        	if ($row["DATE_EXPEDITION"] != null) {
	            $date = new Zend_Date();
	    		$date->set($row["DATE_EXPEDITION"],'yyyy-MM-dd hh:mm:ss');
	            $entry->setDate($date);
            }
        	$entry->setType($row["PAYMENT_TYPE"]);
            $entry->setGiftAddress($row["GIFT_ADDRESS"]);
            $entry->setFraisLivraison($row["FRAIS_LIVRAISON"]);
            $entry->setTypeFraisLivraison($row["LIVRAISON_TYPE"]);
            $entry->setTotal($row["TOTAL"]);
            if ($row["ID_STATUS"] != "") {
            	$entry->setStatus($statusDao->find($row["ID_STATUS"]));
            } 
            if ($row["ID_COMPTE"] != "") {
            	$compteCriteria = new Compte_Search_Criteria();
            	$compteCriteria->setId($row["ID_COMPTE"]);
            	$comptes = $compteDao->find($compteCriteria);
            	$entry->setCompte($comptes[0]);
            } 
            if ($options && array_key_exists("fillCommandeLine", $options) && $options["fillCommandeLine"] == true) {
            	$lineOptions = array();
            	$lineOptions["commandeId"] = $entry->getId();
            	$lineSelect = $commandeLineDao->select($lineOptions);
            	$commandeLineFilter = new Application_Model_CommandeLineFilter();
            	$entry->setLignesCommande($commandeLineFilter->filter($lineSelect->query()->fetchAll(Zend_Db::FETCH_OBJ), array("commandeObject"=>$entry)));
            }
        	if ($row["COMMANDE_DATE"] != null && $row["COMMANDE_DATE"] != "0000-00-00") {
	            $entry->setDate(new Zend_Date(strtotime($row["COMMANDE_DATE"])));
	            $entry->getDate()->setLocale(Constants::getValue("lang"));
	        }
        	if ($row["DATE_EXPEDITION"] != null && $row["DATE_EXPEDITION"] != "0000-00-00") {
	            $entry->setDateExpedition(new Zend_Date(strtotime($row["DATE_EXPEDITION"])));
	            $entry->getDateExpedition()->setLocale(Constants::getValue("lang"));
	        }
            $entries[] = $entry;
        }
        return $entries;    	
    }
Flyin_arno est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 13/01/2012, 12h23   #6
Membre actif
 
Homme Ahmed Benlahsen
Ingenieur BI - Dev Web Senior
Inscription : décembre 2009
Messages : 118
Détails du profil
Informations personnelles :
Nom : Homme Ahmed Benlahsen
Localisation : Maroc

Informations professionnelles :
Activité : Ingenieur BI - Dev Web Senior

Informations forums :
Inscription : décembre 2009
Messages : 118
Points : 157
Points : 157
Envoyer un message via MSN à abenlahsen Envoyer un message via Skype™ à abenlahsen
Salut Flyin_arno,

C'est quoi la ligne 48!? La ligne qui déclenche l'exception ?
abenlahsen est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 13/01/2012, 12h39   #7
Invité de passage
 
Inscription : juillet 2005
Messages : 8
Détails du profil
Informations personnelles :
Âge : 30

Informations forums :
Inscription : juillet 2005
Messages : 8
Points : 2
Points : 2
ah oui je suis bete c'est pas les memes:
Code :
$entry->setDate(new Zend_Date(strtotime($row["COMMANDE_DATE"])));
Ca peut pas etre un probleme qui viendrait d'OVH?
Dans firebug ca me dit 500 internal server error
Flyin_arno est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 13/01/2012, 12h54   #8
Membre actif
 
Homme Ahmed Benlahsen
Ingenieur BI - Dev Web Senior
Inscription : décembre 2009
Messages : 118
Détails du profil
Informations personnelles :
Nom : Homme Ahmed Benlahsen
Localisation : Maroc

Informations professionnelles :
Activité : Ingenieur BI - Dev Web Senior

Informations forums :
Inscription : décembre 2009
Messages : 118
Points : 157
Points : 157
Envoyer un message via MSN à abenlahsen Envoyer un message via Skype™ à abenlahsen
Bingo, c'est la fonction strtotime qui te retourne false ! Pour que cette dernière marche bien ton string doit respecter certaines formats! (cf. http://php.net/manual/fr/function.strtotime.php)

Essaye
Code :
$entry->setDate(new Zend_Date($row["COMMANDE_DATE"], 'yyyy-MM-dd'));
Pour plus de détails sur les formats Zend Cf. http://framework.zend.com/manual/en/...constants.html

Enjoy!
abenlahsen est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 13/01/2012, 15h12   #9
Invité de passage
 
Inscription : juillet 2005
Messages : 8
Détails du profil
Informations personnelles :
Âge : 30

Informations forums :
Inscription : juillet 2005
Messages : 8
Points : 2
Points : 2
Ca marche merci beaucoup!

Bonne journée
Flyin_arno est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 19h13.


 
 
 
 
Partenaires

Hébergement Web