Menu

Changed Provider - still problems

Help
Hobie
2005-01-16
2013-04-26
  • Hobie

    Hobie - 2005-01-16

    I changed my Provider, but I have still errors:

    Maybe its due to my attempt to change the language what also doesnt work. I have searched the forum, and adjusted the entries, but the language is still English. I try the 2005-01-12-Version.

    The login is okay, but then at private/home.php, there is the following error:

    Warning: Cannot modify header information - headers already sent by (output started at /home/www/doc/999/testarea08.de/www/xrms/private/home.php:1) in /home/www/doc/999/testarea08.de/www/xrms/include/i18n.php on line 277

    Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/www/doc/999/testarea08.de/www/xrms/private/home.php:1) in /home/www/doc/999/testarea08.de/www/xrms/include/utils-misc.php on line 36

    [ i18n.php line 277: header( 'Content-Type: text/html; charset=' . $languages[$xrms_notAlias]['CHARSET'] );
    utils-misc.php  line 36: session_start(); ]

    My configuration:

    ----------------------------------
    >> i18n.php:
    --
    global $xrms_language, $languages, $use_gettext;

    if (! isset($xrms_language)) {
        $xrms_language = 'de_DE';
    --

    $languages['de_DE']['NAME']    = 'German';
    $languages['de_DE']['ALTNAME']    = 'Deutsch';
    $languages['de_DE']['CHARSET'] = 'iso-8859-1';
    $languages['de_DE']['LOCALE']  = 'de_DE.ISO-8859-1';
    $languages['de']['ALIAS'] = 'de_DE';
    ----------------------------------

    >> vars.php
    --
    /**
    * Default language
    *
    *   This is the default language. It is used as a last resort
    *   if XRMS can't figure out which language to display.
    *   Language names usually consist of language code, underscore
    *   symbol and country code
    * @global string $xrms_default_language
    */
    $xrms_default_language = 'de_DE';
    --

    /**
    * Default Charset
    *
    * This option controls what character set is used when sending mail
    * and when sending HTML to the browser. Do not set this to US-ASCII,
    * use ISO-8859-1 instead.
    *
    * You can set this option, only if $xrms_default_language setting
    * contains 'en_US' string. In any other case system does not allow
    * making mistakes with incorrect language and charset combinations.
    * @global string $default_charset
    */
    #$default_charset = 'iso-8859-1';   >>> I tried also without the # <<<

    ----------------------------------

    Help much appreciated!
    Greetings,
    Hobie

     
    • Brian Peterson

      Brian Peterson - 2005-01-16

      Warning: Cannot modify header information - headers already sent by

      These errors are almost always caused by a PHP 'feature' that will send headers automatically even for whitespace output. 

      Whitepace after the closing ?> tag on included pages (most likely vars.php and include-locations.inc) will cause PHP to send headers prematurely.

      You need to make sure that these two files (which should be the only files that you have edited) have no spaces, linefeeds, or other whitespace after the closing ?> tags.  As a last resort, you can remove the closing tag entirely, as these files are always included inside an existing <?php tag set...

      What did you try to do to change the language?  Please outline the steps you took.  In general, changing the language is simply a matter of changing the $xrms_default_language variable in vars.php.  Please describe what you tried in detail.  For instance, did you edit the i18n.php file, and if so, why?

      Incidentally, it is probably best to get XRMS working correctly in English before you try internationalization, as localization requires additional PHP modules that may not be present in all installations. 

      Regards,

        - Brian

       
    • Hobie

      Hobie - 2005-01-16

      Hey Brian,

      due to your help, the header error is now fixed!

      The second problem is that after activating "Activities" following error appears:
      -----
      Unable to execute your query. Please correct this error.
      You have an error in your SQL syntax near '(SELECT 'Current User', '-1') UNION (select username, user_id from users where u' at line 1 
      I tried to execute:
      SELECT (CASE WHEN (activity_status = 'o') AND (ends_at < '2005-01-16 22:26:25') THEN 'Yes' ELSE '-' END) AS 'Overdue', at.activity_type_pretty_name AS 'Type',CONCAT('<a href="../contacts/one.php?contact_id=',cont.contact_id,'">',cont.first_names,' ',cont.last_name,'</a>') AS 'Contact',CONCAT('<a href="one.php?activity_id=',a.activity_id,'&amp;return_url=/activities/some.php">',activity_title,'</a>') AS 'Title', DATE_FORMAT(a.scheduled_at,'%Y-%m-%d') AS 'Scheduled', DATE_FORMAT(a.ends_at,'%Y-%m-%d') AS 'Due', CONCAT('<a href="../companies/one.php?company_id=',c.company_id,'">',c.company_name,'</a>') AS 'Company', u.username AS 'Owner', 'n/a' AS '%' FROM companies c, activity_types at, addresses addr, activities a LEFT OUTER JOIN contacts cont ON cont.contact_id = a.contact_id LEFT OUTER JOIN users u ON a.user_id = u.user_id WHERE a.company_id = c.company_id AND a.activity_record_status = 'a' AND at.activity_type_id = a.activity_type_id AND c.default_primary_address=addr.address_id and a.activity_status = 'o' and a.ends_at < from_unixtime(unix_timestamp(CURDATE())+(0)*24*3600) order by 'Overdue' asc 
      -----

      My provider runs MySQL-Version 3.23.55, I am not able to update. Is the problem caused due to this version, or is there a possibility to fix it?

      By the way Brian, you (and your team) are really giving great support (even at sunday ;-). Let me say you, that your work totally imresses me. Many, many big thanks!!

      Hobie

       
      • Brian Peterson

        Brian Peterson - 2005-01-16

        Hobie,

        I'm glad that we've gotten through the Header error.

        The UNION SQL construct is not supported in MySQL 3.23.x, unfortunately.  The 'Current User' and 'Not Set' options that are UNION'd into that query are used to make saved searches more generic.

        You could patch the code in your installation to not use the UNION:

        Change this around line 368:
        //get menu for users
        $sql2 = "(SELECT " . $con->qstr(_("Current User"),get_magic_quotes_gpc()) . ", '-1')"
               . " UNION (select username, user_id from users where user_record_status = 'a' order by username)"
               . " UNION (SELECT " . $con->qstr(_("Not Set"),get_magic_quotes_gpc()) . ", '-2')";

        to this:
        //get menu for users
        $sql2 = "select username, user_id from users where user_record_status = 'a' order by username";

        This will work fine, but will not have the more generic options for use in saved searches.

        It may be possible that in the future we will extend getmenu2 to allow us to add custom fields to a SELECT menu without using SQL UNION clauses, but I can't say that it's really high on our (very long) list of things to do...

        Regards,

          - Brian

         
        • Brian Peterson

          Brian Peterson - 2005-01-17

          Sorry, you should make the change around line 368 of file activities/some.php

          Regards,

            - Brian

           
    • Hobie

      Hobie - 2005-01-17

      Thats fine that there is a solution. But can you please tell me in which file I have to do the changes, I havent found this entries within XRMS (sorry, I am still not that experienced).

       
    • s-t

      s-t - 2005-01-18

      Brian has provided the answer above (in case you missed it)

      xrms install/activities/some.php line 368

       
    • Hobie

      Hobie - 2005-01-19

      Great!!  That was it. Currently, XRMS is running stable in English and everything seems to be fine.

      Big congratulations to the developer team, its really a top software and exactly what I am looking for. Many thanks to all of you for your great work!! One thing is sure: I will highly recommend your prodcuct (and also the fast top support you are giving here) to everybody who ones my opinion

      For now, I have only a question about changing the language to German, what I cannot handle at the moment:

      1) I changed the default language in the vars.php so that it is looking like this:

      -----
      **
      * Default language
      *
      *   This is the default language. It is used as a last resort
      *   if XRMS can't figure out which language to display.
      *   Language names usually consist of language code, underscore
      *   symbol and country code
      * @global string $xrms_default_language
      */
      $xrms_default_language = 'de_DE';
      -----

      2) Nothing happened, so I also changed i18n.php (I added the "-" after ISO:

      -----
      $languages['de_DE']['NAME']    = 'German';
      $languages['de_DE']['ALTNAME']    = 'Deutsch';
      $languages['de_DE']['CHARSET'] = 'iso-8859-1';
      $languages['de_DE']['LOCALE']  = 'de_DE.ISO-8859-1';
      $languages['de']['ALIAS'] = 'de_DE';
      -----

      But after all, the language is still English. What am I missing? (GetText Support = enabled)

      Hobie

       
      • Brian Peterson

        Brian Peterson - 2005-01-19

        Set both
        $xrms_language='de_DE';
        and
        $xrms_default_language='de_DE';

        look for file /etc/locales.build or /etc/locales on your server.  Make sure that the charset in i18n.php matches what you find there.

        The language will not change immediately.  you will need to reload the page at least once.

        What OS and version is the server you are running on using?  I may be able to find more on the Squirrelmail i18n list (XRMS uses Squirrelmail's i18n code, so someone may have had your problem on Squirrelmail, and a solution may already be known)

        Regards,

          - Brian

         
    • Hobie

      Hobie - 2005-01-19

      I assume "$xrms_language='de_DE'" will be the solution, but can you please give me again a tip, in which file $xrms_language is defined.

       
      • Brian Peterson

        Brian Peterson - 2005-01-19

        define $xrms_language right after $xrms_default_language in vars.php.

        as soon as we get user preferences sorted out, $xrms_language will be defined from the user preference.  But for now, just manually define it in vars.php...

        Good Luck ,and report back with more info on your operating system and version if that doesn't work.

         
    • Hobie

      Hobie - 2005-01-20

      I defined it, vars.php is like this now:

      ----
      /**
      * Default language
      *
      *   This is the default language. It is used as a last resort
      *   if XRMS can't figure out which language to display.
      *   Language names usually consist of language code, underscore
      *   symbol and country code
      * @global string $xrms_default_language
      */
      $xrms_default_language = 'de_DE';
      $xrms_language = 'de_DE';

      ---

      Currently, my Provider runs Linux with Apache/1.3.27 and MySQL-Version 3.23.55.

      Hobie

       
      • Brian Peterson

        Brian Peterson - 2005-01-20

        Hobie,

        Check the xrms/install/phpinfo.php page and check to make sure that PHP reports that gettext and recode support are enabled in PHP.  Also, this page should report something about the locale, so that hopefully we can figure out which settings we might need to change in i18n.php.

        Unfortunately, all linux vendor do not code their locales and character sets the same way, so sometimes a little adjustment is necessaary to get it right.

        You may also with to try setting $xrms_language and $xrms_default_language to just 'de'  This works in some linux installations.

        Regards,

          - Brian

         
    • Hobie

      Hobie - 2005-01-20

      GetText Support is enabled. About recode support and the locale I cant find the information. Maybe you can have a short look at the phpinfo >>  http://testarea08.de/phpinfo.php.

      (Only "de" also doesnt work at the moment.)

      Thanks,
      Hobie

       

Log in to post a comment.

Auth0 Logo