×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Character problem. empty comment

Character problem. empty comment 11 years 2 months ago #88

  • Dana Huff
  • Dana Huff's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 0
This looks like a great plug-in and just what I need. I'm glad to see it is being supported again. Hope I can contribute in the future.

But at the moment I'm on the asking end. Installation went well, no problems, and everything looks good in the setup and configuration. Everything is displaying in the articles as expected.

But...when I tested the comment form, again, everything seemed to go well until I sent the comment. When I receive it on the backend in the Manage Comments section, everything is blank. the Writer is always Anonymous and the Comments show up as Character problem. empty comment. This happens whether I am a guest or log on as a registered user. If I enter a URL it comes through as blank.

Using Joomla! 1.5.2 (latest release), RocketTheme template Versatility III, testing with FireFox 3.0.

Any help would be appreciated.

Thanks!

Character problem. empty comment 11 years 2 months ago #89

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
May I get super admin access to your web site to check? (PM it to me)

Character problem. empty comment 11 years 2 months ago #92

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
What is the version of the mysql you are using?

Character problem. empty comment 11 years 2 months ago #95

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Forget about the last question. I found it.
Question: Why is your database collation latin_swedish_1 ? It should be utf8_general_ci with joomla 1.5 .

The problem is comming from that function in utils.php:
function mysql_escape_string($value)
	{   /* depreciated since php 5... */
/*		if (function_exists('mysql_real_escape_string'))
			return mysql_real_escape_string($value);
		else
			return mysql_escape_string($value);
*/
		if (defined('_JOSC_J15'))
	        $database =& JFactory::getDBO();
	    else
			global $database;			
 
//		$database->getEscaped($value);	
		/* getEscaped does not work always for some configurations... strange -> Character problem. empty comment */               
		$result = mysql_real_escape_string( $value, $database->_resource );
		return $result;			
	}

I found that [url] http://de.php.net/mysql_real_escape_string[/url]:

The problem with this function returning an empty string instead of an escaped string seems to be related to the mysql lib versions installed on the server. On 3 servers, each with php 4.3.10, I had no problems on 2 of them, but got the empty string on the 3rd. The 2 that worked had versions 4.1.x and 4.0.x of mysql. The 3rd that did not work had 3.23.x

The failure also only occurred when I did not have a mysql connection set up before running the escape function. If I did DB::connect (using the PEAR DB object) before running the function, it worked, even if I didn't pass in the connection id. If I ran the function before DB::connect, then I got an empty string.

So, if you are getting an empty string, check your mysql lib version and check where you are connecting to the db in relation to calling the escape function in your code.


For some reason the getDBO() is not created and connection to the database is not open (at least I think so).
If anyone has any ideas i will be glad to hear them.

Character problem. empty comment 11 years 2 months ago #96

  • Dana Huff
  • Dana Huff's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 0
Hmmm...not sure how you saw latin_swedish_1. When I checked with phpmyadmin it showed utf8_general_ci.

Anyway, I am running with MySQL 5.0.32. Does that mean there is a configuration constraint on !joomlacomment so that it doesn't currently run on MySQL 5?

Anybody else running on MySQL 5.x with no problems? :S

Character problem. empty comment 11 years 2 months ago #97

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
I'm using MySQL5 and it is working perfectly.
Did you change the admin password? We were working there with Ajay and looking for the problem.

Character problem. empty comment 11 years 2 months ago #98

  • Dana Huff
  • Dana Huff's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 0
Yep, sorry, I thought you were done. I'll PM it to you.

Character problem. empty comment 11 years 2 months ago #100

  • Dana Huff
  • Dana Huff's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 0
PROBLEM SOLVED!!

I got it working! I added the following line to the .htaccess file to force PHP5:

AddType x-mapp-php5 .php

I was actually trying to solve another problem, getting SEF URL's to work (no luck on that one yet) - this was an unexpected benefit!

Thanks, Daniel, for the time and effort you spent on this! I really appreciate it! :)

Character problem. empty comment 11 years 1 month ago #307

  • Snoop
  • Snoop's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 6
  • Thank you received: 0
I still have the same Problem but I know what possibly causes that.
I'm going to explain:

I have an old Webserver running with debian sarge. Usually there is no php5 or new apache or mysql. So I use the "doteb"-Pakcages. Some say its ok to do so, some say thats ugly. But I have no other Way doing this.

Lets see what the Problem is:
Mysql-Version: 5.0.51-2.dotdeb.0
Datenbanksortierung: latin1_swedish_ci <--- !!
PHP-Version: 5.2.6-0.dotdeb.1

phpmyadmin shows what the Problem is and why "latin1_swedish_ci" is shown: The Server Runs on 5.0.51-2 but doteb compiled php 5 with "MySQL-Client-Version: 4.1.15" :/

Im trying to find a way to get this anyway updated but im not positive I can do.
Possibly this causes why "joomla" thinks the swedish charset is used, or as you explained gets no value returned. But phpmyadmin shows that UTF-8 is used and also utf8_unicode_ci
Maybe you can help me?

Thnks in advance.

Character problem. empty comment 11 years 1 month ago #308

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey Snoop!
I'm sorry, but I'm a little bit lost. Is phpmyadmin showing that you use latin1_swedisch_ci or that you use utf8_unicode_ci (the standart is utf8_general_ci)

Character problem. empty comment 11 years 1 month ago #309

  • Snoop
  • Snoop's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 6
  • Thank you received: 0
phpmyadmin is showing the correct utf8_general_ci also apache is set to default charset utf8 and also I told in my php.ini to use utf8 as default charset. :D

I have a bit more to provide: if you post a comment, I get an Alert "Request failed", aftert I click on the OK-Button. the Textarea gets filled with following:
<br />
<b>Warning</b>:  mysql_real_escape_string() expects parameter 2 to be resource, object given in <b>/var/www/http/components/com_comment/joscomment/utils.php</b> on line <b>678</b><br />
<br />
<b>Warning</b>:  mysql_real_escape_string() expects parameter 2 to be resource, object given in <b>/var/www/http/components/com_comment/joscomment/utils.php</b> on line <b>678</b><br />
<br />
<b>Warning</b>:  mysql_real_escape_string() expects parameter 2 to be resource, object given in <b>/var/www/http/components/com_comment/joscomment/utils.php</b> on line <b>678</b><br />
<br />
<b>Warning</b>:  mysql_real_escape_string() expects parameter 2 to be resource, object given in <b>/var/www/http/components/com_comment/joscomment/utils.php</b> on line <b>678</b><br />
<br />
<b>Warning</b>:  mysql_real_escape_string() expects parameter 2 to be resource, object given in <b>/var/www/http/components/com_comment/joscomment/utils.php</b> on line <b>678</b><br />
<br />
<b>Warning</b>:  mysql_real_escape_string() expects parameter 2 to be resource, object given in <b>/var/www/http/components/com_comment/joscomment/utils.php</b> on line <b>678</b><br />
<?xml version="1.0" standalone="yes"?><post><id>4</id><after>-1</after><published>1</published><noerror>1</noerror><debug></debug><body><![CDATA[
<table class='postcontainer' id='post4' width='100%' cellpadding='0' cellspacing='0' style='margin-left:0px;'><!-- style='padding-left:0px;'> -->
	<tr>
		<td><a name='josc4'></a>
<table class='post' width='100%' cellpadding='0' cellspacing='0'>
  <tbody class='sectiontableentry'>
    <tr>
      <td><table class='postheader' width='100%' cellpadding='0' cellspacing='0'>
          <tr>
            <td align='left'>
            	<span class='postusername'>Snoop</span>
 
            </td>
            <td align='right'>
 
				<span class='postnotify0' title='do not notify if new post'>&nbsp;</span>
            	|<span class='postusertype'><span class='administrator'>SAdministrator</span></span>
            	|<span class='createdate'>2008-07-23 15:54:32</span>
            </td>
          </tr>
        </table></td>
    </tr>
    <tr>
      <td colspan='2'><table class='postbody' width='100%' cellpadding='0' cellspacing='0'>
          <tr>
 
			<td style='overflow: hidden;'>Character problem. empty comment</td>
          </tr>
        </table></td>
    </tr>
 
  <tr>
    <td><table class='postfooter' width='100%' cellpadding='0' cellspacing='0'>
        <tr>
          <td align='left'><a href='javascript:JOSC_reply(4)'>Antworten</a> | <a href = 'javascript:JOSC_quote(4)'>Zitat</a> | <a href='javascript:JOSC_editComment(4)'>Bearbeiten</a> | <a href='javascript:JOSC_deleteComment(4)'>L&ouml;schen</a></td>
          <td align='right'><table cellspacing='0' cellpadding='0' border='0'><tr><td><a id='yes4' class='voting_yes' href='javascript:JOSC_voting(4,&#34;yes&#34;)'>0</a></td><td>&nbsp;</td><td><a id='no4' class='voting_no' href='javascript:JOSC_voting(4,&#34;no&#34;)'>0</a></td></tr></table></td>
        </tr>
      </table></td>
  </tr>
 
  </tbody>
</table>
		</td>
	</tr>
</table>
]]></body></post>

As I understand it seems ,$database is empty.

Thanks for your quick answer.

EDIT:
I found out that I can edit these Comments on administrator/index2.php?option=com_comment&task=edit&id=x (x stands for the comment id) :D so its possibly just a frontend-problem.

Character problem. empty comment 11 years 1 month ago #311

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
If you can edit the comments, that means that they are saved in the database.

Character problem. empty comment 11 years 1 month ago #313

  • Snoop
  • Snoop's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 6
  • Thank you received: 0
Im sorry they arent there is just (and always) "Character problem. empty comment" stored. But this text I can edit. But I nver know what the user really tried to post.
any ideas?

So now I altered all joomla-tables and SET them "COLLATE utf8_general_ci" now also administrator/index.php?option=com_admin&task=sysinfo shows correctly "utf8_general_ci". The Error still occurrs if I use mysqli !! I changed to mysql and it works!

Character problem. empty comment 11 years 1 month ago #319

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
So, mysqli is the problem?

Character problem. empty comment 11 years 1 month ago #320

  • Snoop
  • Snoop's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 6
  • Thank you received: 0
yeah seems so. changed to mysql and its running.

Character problem. empty comment 11 years 1 month ago #328

  • Blessed
  • Blessed's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 13
  • Thank you received: 0
i am also experiencing a near simillar problem on my live site : www.businessweekly.co.zw/index.php?optio...s&Itemid=66#JOSC_TOP

but on my production site all seems to be ok: joomla153.dev.co.zw/index.php?option=com...we-stories&Itemid=66

what should i do? :(

Character problem. empty comment 11 years 1 month ago #329

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Ok, if it is working on your production site, then please look for the differences of your configurations. Are the 2 sites on the same server, do you use the same database. And this problem doesn't seem to have something to do with the empty character problem, so I'm going to split the thread.

Character problem. empty comment 11 years 1 month ago #330

  • Blessed
  • Blessed's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 13
  • Thank you received: 0

Ok, if it is working on your production site, then please look for the differences of your configurations.

work in progress

Are the 2 sites on the same server, do you use the same database

No and No

And this problem doesn't seem to have something to do with the empty character problem


well in the backend for some of the comments there is the "Character problem. empty comment" so im not too sure if this is linked to the problem i stated above.

i hope this info helps.

Character problem. empty comment 11 years 1 month ago #334

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
different servers, different configuration. Please look if you use mysqli or only mysql.

Character problem. empty comment 11 years 1 month ago #335

  • Blessed
  • Blessed's Avatar
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 13
  • Thank you received: 0

different servers, different configuration. Please look if you use mysqli or only mysql.


hmmmmmm? i guess you are right. on my development server (where all is well) there is both MySQL Support enabled and mysqli support enabled whereas on the live server mysqli support section is not there on the system info list, in the backend. could be my problem hey?can i go ahead and ask my host to enable/install that for me?
  • Page:
  • 1
  • 2
Time to create page: 0.103 seconds