We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22851
    • 805 Posts
    Even if the URL entered was not correct, it shouldn’t get into an infinite redirection loop. It should, in this instance, return the page not found document with the correct page not found status code. So, this is a bug. Will fix.
      YAMS: Yet Another Multilingual Solution for MODx
      YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
      Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
      • 18250
      • 37 Posts
      Funny thing, i got this error:

      Fatal error: Call to undefined function mb_strtolower() in C:\www\gorenc\assets\modules\yams\class\yams.class.inc.php on line 3847


      while accessing my home page of the default language (not on other languages).

      I use (test) your newest alpha release and my PHP version is 5+.

      Changing function to strtolower() would probably fix the issue..

      PS. i find YAMS best multi lingual solution there is for Modx.. keep up the good work! I’ll let you know about my future issues I might have while setting up all the snippets i need wink
        • 22851
        • 805 Posts
        That’s very weird. According to the php documentation for mb_strtolower this function should be available by default in all versions of php >= 4.3.0 - and since YAMS doesn’t work at all with versions of PHP less than 5 anyway, I thought it was safe to use. What version of PHP are you using? Could it be a custom build of PHP without the mbstring library?

        Anyway, you are right - I recently changed YAMS to call that function on the encoded version of the URL - which shouldn’t contain any multibyte characters anyway. So, it is safe to change it to strtolower. I’ll make that change in the next version. In the meantime, could you patch your copy yourself?

        EDIT: Hang on... You said it only does that for the home page of the default language. Very strange. It must be receiving something that isn’t a string as an argument. I’ll check out what’s causing that. Thanks for the report.
          YAMS: Yet Another Multilingual Solution for MODx
          YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
          Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Only if it’s compiled in.
          mbstring is a non-default extension. This means it is not enabled by default. You must explicitly enable the module with the configure option. See the Install section for details.
          Note: As of PHP 4.3.4, all supported encoding by libmbfl is enabled with --enable-mbstring.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 18250
            • 37 Posts
            I fixed it with changing to strtolower, and all works great now. Aliases work very nice no issues so far.
            @susan - I should probably enable it in php.ini. To bad it’s not included by default.

            cheers
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              If the PHP wasn’t compiled with that option in the compilation configuration, it won’t be available.

              AjaxSearch has a parameter to enable/disable the use of mbstring functions; it might be possible to have conditionals that test to see if it’s available and use them if it is, and use other functions if it isn’t.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 22851
                • 805 Posts
                I knew there was a reason I specifically decided to avoid using the php mbstring library. I myself have had problems with it not being installed on an old system in the past so that (an older version of) AjaxSearch wouldn’t work. Now I’m glad I did avoid it. The place @marclar mentioned is the only place where I recently introduced an mbstring function - and fortunately it isn’t even required there after all. So, no AjaxSearch style php mbstring style switch will be necessary in this case.

                Thanks for the info sottwell.
                  YAMS: Yet Another Multilingual Solution for MODx
                  YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
                  Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
                  • 22851
                  • 805 Posts
                  I have been investigating why the following
                  [+content:limit=`300`+]

                  doesn’t output the correct content when used in a ditto template. YAMS works with Ditto by replacing placeholders with a special yams-select construct that includes multiple-language versions of the content from which the correct language will be selected later. When PHx is used too, like in the above example, Ditto will first request the content of the placeholder from the YAMS ditto extender - which will return the yams-select construct - and then Ditto will apply PHx rules to the output. In the example above the rule involves truncating the output - which destroys the integrity of the yams-select construct resulting in broken yams code appearing in the output.

                  The only not-very-elegant workaround that I have for this particular case is as follows: Write out a yams-select construct explicitly, letting ditto apply phx to the actual placeholders. For a website with English (en), Spanish (es) and Russian (ru) the appropriate construct would be:

                  (yams-select:9999[+id+])(lang:9999[+id+]:en)[+content_en:limit=`300`+](lang:9999[+id+]:es)[+content_es:limit=`300`+](lang:9999[+id+]:ru)[+content_ru:limit=`300`+](/yams-select:9999[+id+])
                  


                  This construct assumes that all the documents in the ditto output are multilingual.

                  Normally I’d advise against using YAMS constructs explicitly. Instead its best to use a YAMS snippet call - which will automatically adjust the constructs when new languages are added and knows how which documents are multi- and mono- lingual. However, it’s not possible to do that inside a ditto template in a way which will work with PHx unfortunately.

                  I’ve got some ideas for how this workaround might be avoided in future, in a way which would tie in with some changes designed to improve efficiency by avoiding the need for the 1000s of mysql queries currently required to grab multilingual content when using lots of large ditto and wayfinder calls.
                    YAMS: Yet Another Multilingual Solution for MODx
                    YAMS Forums | Latest: YAMS 1.1.9 | YAMS Documentation
                    Please consider donating if you appreciate the time and effort spent developing and supporting YAMS.
                    • 30497
                    • 245 Posts
                    I have been using vanilla wayfinder calls since getting YAMS up and running a few days ago - I knew Wayfinder wasn’t supposed to work like this, but, it was working anyway.... sort of. Today I discovered that while most of the time my wayfinder menus are in the same language as the page i am viewing, sometimes that load in a different language...

                    So, I turned to the YAMS docs and see I am supposed to add this to all Wayfinder calls:

                    &rowTpl=`@FILE:assets/modules/yams/tpl/wayfinder/mode/row.tpl` &parentRowHereTpl=`@FILE:assets/modules/yams/tpl/wayfinder/mode/parentrowhere.tpl` &parentRowTpl=`@FILE:assets/modules/yams/tpl/wayfinder/mode/parentrow.tpl` &hereTpl=`@FILE:assets/modules/yams/tpl/wayfinder/mode/here.tpl` &innerRowTpl=`@FILE:assets/modules/yams/tpl/wayfinder/mode/innerrow.tpl` &innerHereTpl=`@FILE:assets/modules/yams/tpl/wayfinder/mode/innerhere.tpl` &activeParentRowTpl=`@FILE:assets/modules/yams/tpl/wayfinder/mode/activeparentrow.tpl` &categoryFoldersTpl=`@FILE:assets/modules/yams/tpl/wayfinder/mode/categoryfolders.tpl` &startItemTpl=`@FILE:assets/modules/yams/tpl/wayfinder/mode/startitem.tpl`


                    Do I really need all that? I only use &rowTpl in my calls. I guess I have to customize your &rowTpl=`@FILE:assets/modules/yams/tpl/wayfinder/mode/row.tpl so that it matches my own rowTpl.
                      • 19149
                      • 8 Posts
                      I see that in YAMS-Configuration-Server Config use rules with symbol $ :

                      RewriteCond ${REQUEST_FILENAME} !-f
                      RewriteCond ${REQUEST_FILENAME} !-d


                      But it’s not work. I fix it - changed to %:
                      RewriteCond %{REQUEST_FILENAME} !-f
                      RewriteCond %{REQUEST_FILENAME} !-d


                      I don’t know why smiley

                      And another question.
                      [[YAMS? &get=`text` &from=`ru::от "первого "лица"`]]

                      In example page show only - ’от "первого ’. I think YAMS don’t recognize entity.