The Joomla! Forum ™






Post new topic Reply to topic  [ 14 posts ] 
Author Message
PostPosted: Mon Feb 13, 2006 3:02 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sat Aug 20, 2005 11:19 am
Posts: 30
Location: Singapore
Hi,

after the good news about installation, unfortunately some bad news  :( .  When I try to loginto the newly installed site, joomla fails with a stack trace (see below). I tried to login as admin to both the site and to the administration. SVN 2326

regards,
Charles

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="" lang="" dir="" >
<head>
      <title>joomla test - Joomla 1.1 - Error</title>
   <base href="h" />
   <meta name="Generator" content="Joomla! 1.1" />
   <link rel="stylesheet" href="templates/_system/css/error.css" type="text/css" />
</head>
<body>
   <table width="550" align="center" class="outline">
   <tr>
      <td align="center">
         <h1>
            <jos:translate>An error has occurred</jos:translate>
         </h1>
      </td>
   </tr>
   <tr>
      <td width="39%" align="center">
         <div class="Frame"><div style="margin-bottom:8px;"><span class="Type">Error:</span> JDatabase::getInstance: Could not connect to database in C:\amp\doc_root\joomla\libraries\joomla\application\application.php on line 417</div>
Details:
<table border="0" cellpadding="0" cellspacing="0" class="Table">
<tr><td colspan="3" align="left" class="TD"><strong>Call stack</strong></td>   </tr>
<tr>      <td class="TD"><strong>#</strong></td>      <td class="TD"><strong>Function</strong></td>      <td class="TD"><strong>Location</strong></td>   </tr>
<tr>      <td class="TD">1</td>   <td class="TD">JApplication->login()</td>      <td class="TD">C:\amp\doc_root\joomla\administrator\index.php:53</td>   </tr>
<tr>      <td class="TD">2</td>   <td class="TD">JAuthenticate->login()</td>      <td class="TD">C:\amp\doc_root\joomla\libraries\joomla\application\application.php:223</td>   </tr>
<tr>      <td class="TD">3</td>   <td class="TD">JModelSession->update()</td>      <td class="TD">C:\amp\doc_root\joomla\libraries\joomla\application\user\authenticate.php:166</td>   </tr>
<tr>      <td class="TD">4</td>   <td class="TD">JText->_()</td>      <td class="TD">C:\amp\doc_root\joomla\libraries\joomla\model\model\session.php:73</td>   </tr>
<tr>      <td class="TD">5</td>   <td class="TD">JApplication->getLanguage()</td>      <td class="TD">C:\amp\doc_root\joomla\libraries\joomla\i18n\language.php:37</td>   </tr>
<tr>      <td class="TD">6</td>   <td class="TD">JApplication->setLanguage()</td>      <td class="TD">C:\amp\doc_root\joomla\libraries\joomla\application\application.php:465</td>   </tr>
<tr>      <td class="TD">7</td>   <td class="TD">JApplication->getUser()</td>      <td class="TD">C:\amp\doc_root\joomla\libraries\joomla\application\application.php:297</td>   </tr>
<tr>      <td class="TD">8</td>   <td class="TD">JUser->getInstance()</td>      <td class="TD">C:\amp\doc_root\joomla\libraries\joomla\application\application.php:448</td>   </tr>
<tr>      <td class="TD">9</td>   <td class="TD">JUser->__construct()</td>      <td class="TD">C:\amp\doc_root\joomla\libraries\joomla\application\user\user.php:106</td>   </tr>
<tr>      <td class="TD">10</td>   <td class="TD">JApplication->getDBO()</td>      <td class="TD">C:\amp\doc_root\joomla\libraries\joomla\application\user\user.php:67</td>   </tr>
<tr>      <td class="TD">11</td>   <td class="TD">JError->raiseError()</td>      <td class="TD">C:\amp\doc_root\joomla\libraries\joomla\application\application.php:417</td>   </tr>
<tr>      <td class="TD">12</td>   <td class="TD">JError->raise()</td>      <td class="TD">C:\amp\doc_root\joomla\libraries\joomla\utilities\error.php:54</td>   </tr>
<tr>      <td class="TD">13</td>   <td class="TD">patError->__construct()</td>      <td class="TD">C:\amp\doc_root\joomla\libraries\joomla\utilities\error.php:126</td>   </tr></table></div>
      </td>
   </tr>
   </table>
</body>
</html>


Last edited by Jinx on Thu Feb 16, 2006 2:25 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: login does not work
PostPosted: Mon Feb 13, 2006 6:44 pm 
User avatar
Joomla! Champion
Joomla! Champion
Offline

Joined: Fri Aug 12, 2005 12:47 am
Posts: 6566
I did a fresh install of rev 2329 and can't replicate the problem. Could u do a fresh checkout and try again ?

_________________
Johan Janssens - Joomla Co-Founder, Lead Developer of Joomla 1.5

http://www.nooku.org - multi-lingual content manager and rapid extension development framework for Joomla 1.5
http://www.joomlatools.eu - training, consulting and extension development


Top
 Profile  
 
PostPosted: Mon Feb 13, 2006 9:51 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sat Feb 11, 2006 1:11 pm
Posts: 6
Hi Johan Janssens!

An important question:
Did you install on Windows with IIS?

If not, then probably you won't get this error. But on Windows + IIS 5 + PHP 5.1.2 + MySQL 5.0.18, you cannot login to the admin surface after installation of rev. 2329, but you will get this error.

I tried to debug this error and found that the error message is:
Quote:
Incorrect integer value: '' for column 'guest' at row 1
SQL=UPDATE jos_session SET `time`='1139840561',`userid`='62',`usertype`='Super Administrator', `username`='admin',`gid`='2',`guest`='' WHERE session_id='1e6bb241d664c535d6265c73722c1848'

See lines 410 and 411 of libraries/joomla/database/database/mysql.php:
Quote:
         if( $v == '' ) {
            $val = $this->isQuoted( $v ) ? $this->Quote( '' ) : 0;


If your SQL statement contains a fildname=0 (e.g. in this case: guest=0) then the if( $v == '' ) clause will be true on Windows + IIS 5 + PHP 5.1.2 + MySQL 5.0.18, thus since isQuoted( $v ) will be also true, the above code will set $val = $this->Quote( '' ) which means that $val will be an empty string ('') instead of the correct '0' value.

Probably on Unix/Linux environments this isQuoted() returns false or if( $v == '' ) clause will be false in case of $v = 0. That's why I think this bug will only be reproducible on Win32 environments.

But I do not really know what determines isQuoted() and also don't understand why $v=='' is true when $v=0.
Can you probably tell me in what circumstances will isQuoted() be true or false? What does it depend on?

See also my bug report:
http://forge.joomla.org/sf/go/artf3506?nav=1

Best regards,
Tibor


Last edited by bekesit on Tue Feb 14, 2006 3:47 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Tue Feb 14, 2006 3:31 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sat Aug 20, 2005 11:19 am
Posts: 30
Location: Singapore
Hi,

I synched up to revision 2365 - same problem.  Re-installed, same problem. My stack is
- Windows XP
- Apache 2.0.55
- MySQL  5.0.18 - Client API version 4.1.7
- PHP 5.1.1

regards,
Charles

Stack trace:
Call stack
# Function Location
1 JApplication->login() C:\amp\doc_root\joomla\administrator\index.php:53
2 JAuthenticate->login() C:\amp\doc_root\joomla\libraries\joomla\application\application.php:223
3 JModelSession->update() C:\amp\doc_root\joomla\libraries\joomla\application\user\authenticate.php:166
4 JText->_() C:\amp\doc_root\joomla\libraries\joomla\model\model\session.php:73
5 JApplication->getLanguage() C:\amp\doc_root\joomla\libraries\joomla\i18n\language.php:37
6 JApplication->setLanguage() C:\amp\doc_root\joomla\libraries\joomla\application\application.php:465
7 JApplication->getUser() C:\amp\doc_root\joomla\libraries\joomla\application\application.php:297
8 JUser->getInstance() C:\amp\doc_root\joomla\libraries\joomla\application\application.php:448
9 JUser->__construct() C:\amp\doc_root\joomla\libraries\joomla\application\user\user.php:106
10 JApplication->getDBO() C:\amp\doc_root\joomla\libraries\joomla\application\user\user.php:67
11 JError->raiseError() C:\amp\doc_root\joomla\libraries\joomla\application\application.php:417
12 JError->raise() C:\amp\doc_root\joomla\libraries\joomla\utilities\error.php:54
13 patError->__construct() C:\amp\doc_root\joomla\libraries\joomla\utilities\error.php:126


Top
 Profile  
 
PostPosted: Tue Feb 14, 2006 3:52 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sat Feb 11, 2006 1:11 pm
Posts: 6
Hi Charles,

Could you please try the following:
Modify lines 410 and 411 of libraries/joomla/database/database/mysql.php the following way:
Quote:
        if( $v == '0' ) {
            $val = $this->isQuoted( $v ) ? $this->Quote( '0' ) : 0;


Then, try to login to the admin interface, and please give me a feedback whether it works or not.

Best regards,
Tibor


Top
 Profile  
 
PostPosted: Tue Feb 14, 2006 4:16 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sat Aug 20, 2005 11:19 am
Posts: 30
Location: Singapore
Hi,

that did the trick... code in function updateObject changed to
Code:
         if( $v == '0' ) {
            $val = $this->isQuoted( $v ) ? $this->Quote( '0' ) : 0;
         } else if( $v == '' ) {
            $val = $this->isQuoted( $v ) ? $this->Quote( '' ) : 0;
         } else  {
            $val = $this->isQuoted( $v ) ? $this->Quote( $v ) : $v;
         }


regards,
Charles


Top
 Profile  
 
PostPosted: Tue Feb 14, 2006 4:53 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sat Feb 11, 2006 1:11 pm
Posts: 6
Hi Charles,

The same for me ;) However, I would be curious when the below two lines are really used (and for what):
Quote:
} else if( $v == '' ) {
$val = $this->isQuoted( $v ) ? $this->Quote( '' ) : 0;

since I cannot imagine the case when a fieldname='' need to be converted to fieldname=0, and all the other cases are handled in the last else clause:
Quote:
} else  {
$val = $this->isQuoted( $v ) ? $this->Quote( $v ) : $v;
}

Another question to you:
After logged in on the admin interface is for example the "Global Configuration" section working for you?

Best regards,
Tibor


Top
 Profile  
 
PostPosted: Wed Feb 15, 2006 1:34 pm 
User avatar
Joomla! Champion
Joomla! Champion
Offline

Joined: Fri Aug 12, 2005 12:47 am
Posts: 6566
Fixed on SVN and asked Andrew for feedback on the neccessity of that line.

_________________
Johan Janssens - Joomla Co-Founder, Lead Developer of Joomla 1.5

http://www.nooku.org - multi-lingual content manager and rapid extension development framework for Joomla 1.5
http://www.joomlatools.eu - training, consulting and extension development


Top
 Profile  
 
PostPosted: Wed Feb 15, 2006 4:49 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sat Aug 20, 2005 11:19 am
Posts: 30
Location: Singapore
Hi,

I updated to SVN revision 2380 and still get this error...  :(

regards,
Charles


Top
 Profile  
 
PostPosted: Wed Feb 15, 2006 9:25 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Sat Feb 11, 2006 1:11 pm
Posts: 6
Hi!

I am very glad to confirm that revision 2384 is one of the first revisions of Joomla 1.1 that allows to log in to the admin interface on Win32 platform. ;D
Many thanks to Johan Janssens!


Of course, I still keep up that a general look through would be still beneficial for having a consistent quoting everywhere in the code. (See artifact: http://forge.joomla.org/sf/go/artf3506?nav=1 for details)

At the same time, I would like to inform You that the admin interface is still buggy on Windows, especially the Global Configuration section:

Image

As You can see on the screenshot most of the errors are caused by the missing $_SERVER['REQUEST_URI'] PHP variable that is not supported on all platforms (e.g. Win32 + IIS + PHP running in CGI mode).
That's why I think that something like the following fallback solution, would be better:
Quote:
if(!empty($_SERVER['REQUEST_URI']))
{
$uri = $_SERVER['REQUEST_URI'];
}
else
{
$uri = $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING'];
}

And probably the even more professional (if not the best) way would be to use consequently the getInstance() fcn. of the JURI class in libraries\joomla\application\environment\uri.php implemented by Louis Landry as far as I know just exactly for this purpose:
Quote:
/**
* JURI Class
*
* This class serves two purposes.  First to parse a URI and provide a common interface
* for the Joomla Framework to access and manipulate a URI.  Second to attain the URI of
* the current executing script from the server regardless of server.
...


I strongly believe that it would be quite a big competitive advantage if Joomla! 1.1 8) could keep its traditions to run platform independently. What do you think?

Best regards,
Tibor

P.s.: a new minor bug encountered on the login page of the admin interface:
Notice: Undefined variable: name in c:\Inetpub\wwwroot\trunk\libraries\joomla\document\document.php on line 488


Last edited by bekesit on Wed Feb 15, 2006 10:55 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Thu Feb 16, 2006 2:25 am 
User avatar
Joomla! Champion
Joomla! Champion
Offline

Joined: Fri Aug 12, 2005 12:47 am
Posts: 6566
Thanks for the feedback, the REQUEST_URI problem in the configuration has been fixed. I also fixed the notice in the document.php class. I'm closing this report. If u find any other problems on IIS please report them in a new thread. Thanks !

_________________
Johan Janssens - Joomla Co-Founder, Lead Developer of Joomla 1.5

http://www.nooku.org - multi-lingual content manager and rapid extension development framework for Joomla 1.5
http://www.joomlatools.eu - training, consulting and extension development


Top
 Profile  
 
PostPosted: Tue May 30, 2006 7:26 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Thu Dec 22, 2005 11:21 am
Posts: 15
Location: Cachoeirinha - RS - Brasil
Hi,

I´m a little bit late, but I saw the same problem on mysql.php

I would know how have you fixed the problem... Is it as following?

function updateObject( $table, &$object, $keyName, $updateNulls=true )
{
$fmtsql = "UPDATE $table SET %s WHERE %s";
$tmp = array();
foreach (get_object_vars( $object ) as $k => $v) {
if( is_array($v) or is_object($v) or $k[0] == '_' ) { // internal or NA field
continue;
}
if( $k == $keyName ) { // PK not to be updated
$where = $keyName . '=' . $this->Quote( $v );
continue;
}
if ($v === NULL && !$updateNulls) {
continue;
}

if( $v === '' ) {
$val = $this->isQuoted( $v ) ? $this->Quote( '' ) : 0;
} else {
$val = $this->isQuoted( $v ) ? $this->Quote( $v ) : $v;
}
$tmp[] = $this->NameQuote( $k ) . '=' . $val;
}
$this->setQuery( sprintf( $fmtsql, implode( ",", $tmp ) , $where ) );
return $this->query();
}


That works here...

Have you made another change?

Thank you!

_________________
Flybyte
(Joelso Dias)


Last edited by flybyte on Tue May 30, 2006 7:29 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Fri Jan 05, 2007 1:34 pm 
Joomla! Apprentice
Joomla! Apprentice
Offline

Joined: Tue Nov 14, 2006 9:52 pm
Posts: 44
Hi' there
I've experience the same login difficulties - but after unpublishing the joomfish and the abstraction layer bot it work again... Is there anyone that have some ideas on how to make the login form work on a multilingual site???

Are we talking on a joomfish install problem or something completely different...
Yours

Claus


Top
 Profile  
 
PostPosted: Fri Jan 05, 2007 6:31 pm 
User avatar
Joomla! Champion
Joomla! Champion
Offline

Joined: Fri Aug 12, 2005 12:47 am
Posts: 6566
It looks like this would be a joomfish specific problem, have you contacted their developers ?

_________________
Johan Janssens - Joomla Co-Founder, Lead Developer of Joomla 1.5

http://www.nooku.org - multi-lingual content manager and rapid extension development framework for Joomla 1.5
http://www.joomlatools.eu - training, consulting and extension development


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 



Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group