Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • quachnguyen 12 posts 32 karma points
    Oct 28, 2012 @ 18:49
    quachnguyen
    0

    Umbraco Russia multi website language bug

    Dear all,

    I have create umbraco website which content 3 language as structure bellow:

    Root
    - en (http://mydomain.com/en)
    ---Home
    ---Contact
    ......

    - vi (http://mydomain.com/vi)
    ---Trang-Chu
    ---Lien-He

    - ru (http://mydomain.com/ru)
    ---
    ---contact

    I have used multilanguage tool package by Yannick Smits, Everything work ok except ru site. In umbraco config file (umbracoSettings.config), I have configured

    <errors>
     <error404 culture="ru-RU">1398</error404>
    </errors>

    I always get page not found when I switch to russia website which contain russia url character, but If I open such as: http://mydomain.com/ru/contact, It work fine, I don't know how to config or change my configuration to by pass this issue

    Hint: all russia url characters didn't work: ,  & ,  ... here is my replace character list

            <urlReplacing removeDoubleDashes="true">
            <char org="">b</char>
                <char org=" ">-</char>
                <char org="&quot;"></char>
                <char org="'"></char>
                <char org="%"></char>
                <char org="."></char>
                <char org=";"></char>
                <char org="/"></char>
                <char org="\"></char>
                <char org=":"></char>
                <char org="#"></char>
                <char org="+">plus</char>
                <char org="*">star</char>
                <char org="&amp;"></char>
                <char org="?"></char>
                <char org="æ">ae</char>
                <char org="ø">oe</char>
                <char org="å">aa</char>
                <char org="ä">ae</char>
                <char org="ö">oe</char>
                <char org="ü">ue</char>
                <char org="ß">ss</char>
                <char org="Ä">ae</char>
                <char org="Ö">oe</char>
                <char org="|">-</char>
                <char org="&lt;"></char>
                <char org="&gt;"></char>
                <char org="á">a</char>
                <char org="à">a</char>
                <char org="">a</char>
                <char org="">a</char>
                <char org="ã">a</char>
                <char org="â">a</char>
                <char org="">a</char>
                <char org="">a</char>
                <char org="">a</char>
                <char org="">a</char>
                <char org="">a</char>
                <char org="">a</char>
                <char org="">a</char>
                <char org="">a</char>
                <char org="">a</char>
                <char org="">a</char>
                <char org="">a</char>
                <char org="Á">a</char>
                <char org="À">a</char>
                <char org="">a</char>
                <char org="">a</char>
                <char org="Ã">a</char>
                <char org="Â">a</char>
                <char org="">a</char>
                <char org="">a</char>
                <char org="">a</char>
                <char org="">a</char>
                <char org="">a</char>
                <char org="">a</char>
                <char org="">a</char>
                <char org="">a</char>
                <char org="">a</char>
                <char org="">a</char>
                <char org="">a</char>
                <char org="é">e</char>
                <char org="è">e</char>
                <char org="">e</char>
                <char org="">e</char>
                <char org="">e</char>
                <char org="ê">e</char>
                <char org="">e</char>
                <char org="">e</char>
                <char org="">e</char>
                <char org="">e</char>
                <char org="">e</char>
                <char org="É">e</char>
                <char org="È">e</char>
                <char org="">e</char>
                <char org="">e</char>
                <char org="">e</char>
                <char org="Ê">e</char>
                <char org="">e</char>
                <char org="">e</char>
                <char org="">e</char>
                <char org="">e</char>
                <char org="">e</char>
                <char org="ó">o</char>
                <char org="ò">o</char>
                <char org="">o</char>
                <char org="">o</char>
                <char org="õ">o</char>
                <char org="ô">o</char>
                <char org="">o</char>
                <char org="">o</char>
                <char org="">o</char>
                <char org="">o</char>
                <char org="">o</char>
                <char org="">o</char>
                <char org="">o</char>
                <char org="">o</char>
                <char org="">o</char>
                <char org="">o</char>
                <char org="">o</char>
                <char org="Ó">o</char>
                <char org="Ò">o</char>
                <char org="">o</char>
                <char org="">o</char>
                <char org="Õ">o</char>
                <char org="Ô">o</char>
                <char org="">o</char>
                <char org="">o</char>
                <char org="">o</char>
                <char org="">o</char>
                <char org="">o</char>
                <char org="">o</char>
                <char org="">o</char>
                <char org="">o</char>
                <char org="">o</char>
                <char org="">o</char>
                <char org="">o</char>
                <char org="ú">u</char>
                <char org="ù">u</char>
                <char org="">u</char>
                <char org="">u</char>
                <char org="">u</char>
                <char org="">u</char>
                <char org="">u</char>
                <char org="">u</char>
                <char org="">u</char>
                <char org="">u</char>
                <char org="">u</char>
                <char org="Ú">u</char>
                <char org="Ù">u</char>
                <char org="">u</char>
                <char org="">u</char>
                <char org="">u</char>
                <char org="">u</char>
                <char org="">u</char>
                <char org="">u</char>
                <char org="">u</char>
                <char org="">u</char>
                <char org="">u</char>
                <char org="í">i</char>
                <char org="ì">i</char>
                <char org="">i</char>
                <char org="">i</char>
                <char org="">i</char>
                <char org="Í">i</char>
                <char org="Ì">i</char>
                <char org="">i</char>
                <char org="">i</char>
                <char org="">i</char>
                <char org="">d</char>
                <char org="">d</char>
                <char org="ý">y</char>
                <char org="">y</char>
                <char org="">y</char>
                <char org="">y</char>
                <char org="">y</char>
                <char org="Ý">y</char>
                <char org="">y</char>
                <char org="">y</char>
                <char org="">y</char>
                <char org="">y</char>
            <!--
                <char org="">b</char>
                <char org="">b</char>
                <char org="">v</char>
                <char org="">v</char>
                <char org="">g</char>
                <char org="">g</char>
                <char org="">d</char>
                <char org="">d</char>
                <char org="">j</char>
                <char org="">j</char>
                <char org="">z</char>
                <char org="">z</char>
                <char org="">i</char>
                <char org="">i</char>
                <char org="">j</char>
                <char org="">j</char>
                <char org="">k</char>
                <char org="">k</char>
                <char org="">l</char>
                <char org="">l</char>
                <char org="">m</char>
                <char org="">m</char>
                <char org="">n</char>
                <char org="">n</char>
                <char org="">p</char>
                <char org="">p</char>
                <char org="">t</char>
                <char org="">t</char>
                <char org="">u</char>
                <char org="">u</char>
                <char org="">f</char>
                <char org="">f</char>
                <char org="">h</char>
                <char org="">h</char>
                <char org="">c</char>
                <char org="">c</char>
                <char org=""></char>
                <char org=""></char>
                <char org="">y</char>
                <char org="">y</char>
                <char org="">e</char>
                <char org="">e</char>
                <char org="">yo</char>
                <char org="">yo</char>
                <char org="">sh</char>
                <char org="">sh</char>
                <char org="">ju</char>
                <char org="">ju</char>
                <char org="">ja</char>
                <char org="">ja</char>
                <char org="">tch</char>
                <char org="">tch</char>
                <char org="">chtch</char>
                <char org="">chtch</char>-->          
            </urlReplacing>

    Please help me to fix this issue
    QuachNguyen

  • Stephen 767 posts 2273 karma points c-trib
    Oct 29, 2012 @ 09:17
    Stephen
    0

    Which version of Umbraco are you running?

    I'm trying to understand what you describe... so domain.com/ru/contact works, but domain.com/ru does not? It's only the home page that fails?

    I your tree it looks like the EN homepage is _Home_, the VI homepage is _Trang-Chu_, but the RU homepage has no name? What is the exact name of the node in the tree?

  • quachnguyen 12 posts 32 karma points
    Oct 29, 2012 @ 18:24
    quachnguyen
    0

    Thanks Stephen for your reply!

    I have been working on source code version on https://hg.codeplex.com/umbraco

    I solved my issue when I get the lastest version of umbraco (source code) which includes "U4-1089 - non-ascii chars in urls cause 404", I named my russia home page is , then replace with "dm".

    I also got another issue when I working on souce code version, I didn't use call service by using restExtensions.config, although I have configured like your wiki example

    <RestExtensions>
         <ext assembly="TestClass" type="BaseTest.TestClass" alias="TestClass">
        <permission method="Hello" allowAll="true" />
      </ext>
    </RestExtensions>

    I always get null object reference error message. tell me if I missing something
    Thanks
    Nguyen 

  • Stephen 767 posts 2273 karma points c-trib
    Oct 29, 2012 @ 19:08
    Stephen
    0

    Oh so you are running 4.10. Fine. Glad that the issue is fixed.

    Now about REST extensions... your restExtensions.config files looks good. It means you have a class BaseTest.TestClass in assembly TestClass.dll, and that class has a public static method Hello. You can call it by calling domain.com/base/TestClass/Hello and it should return whatever the method returns. If you get a NullRef exception when hitting that url, can you post more details about the exception: stacktrace, etc?

  • quachnguyen 12 posts 32 karma points
    Nov 01, 2012 @ 15:28
    quachnguyen
    0



    Here is my death yellow screen

    Thank you
    Nguyen 

  • Stephen 767 posts 2273 karma points c-trib
    Nov 01, 2012 @ 18:09
    Stephen
    0

    Great. Now if you could also sent the DLL that contains the method, along with your config file... sgay _at_ pilotine.com. Thanks!

    edit: that would be resetExtensions.config, web.config, and BaseRestExtensions.config _if_ you have it.

  • Stephen 767 posts 2273 karma points c-trib
    Nov 01, 2012 @ 18:49
    Stephen
    0

    OK, I *think* I know what's wrong. I just have pushed a fix to 4.10 so if you can pull from Codeplex and try again...

  • quachnguyen 12 posts 32 karma points
    Nov 01, 2012 @ 21:06
    quachnguyen
    0

    The firstly! I would like to thank you for your contribution!

    I have spent all night to figure out this issue, I'm new in umbraco world, I did try to dig into your source code, then I fixed before you have pulled your bug fix to repository, I realize that maybe your code still have some issue because of confliction in your configuration file and your code.

    Here is an issue:

    In web.config I got BaseRestExtensions

    <section name="BaseRestExtensions" type="Umbraco.Web.BaseRest.Configuration.BaseRestSection, umbraco" requirePermission="false" />

    And

    <BaseRestExtensions configSource="config\BaseRestExtensions.config" /> 

    Here is BaseRestExtentions.config's content:

    xml version="1.0" encoding="utf-8"?> <BaseRestExtensions>   BaseRestExtensions> 

    But in your Umbraco.Web\umbraco.presentation\umbracobase\restExtension.cs file

    XmlNode baseExt = baseDoc.SelectSingleNode("/RestExtensions/ext [@alias='" + extensionAlias + "']/permission [@method='" + methodName + "']");

    I guess that you always get the message like: "Extension or method not found.", because there is no node with RestExtensions, instead of BaseRestExtensions.

    When I swith to restExtensions.config, I got your note:  

    <!-- this is the pre-4.10 rest configuration --> <!-- you should use BaseRestExtensions.config instead -->

    Now question for you: 
    1. What are differentiate between BaseRestExtensions.config and restExtensions.config
    2. When I mark my method as: [RestExtensionMethod(returnXml = false)] and then in the config file I set It to <permissionmethod="GoHome"returnXml="true"allowAll="true"/> What is the return attritbute of GoHome method?

    Please suggest me if i was worng!
    Thanks
    QuachNguyen

  • Stephen 767 posts 2273 karma points c-trib
    Nov 01, 2012 @ 22:11
    Stephen
    0

    You either use restExtensions.config (old system) or BaseRestExtensions.config (new system) and they don't have the same syntax.

    Old one (restExtensions.config):

    <RestExtensions>
        <ext assembly="TestAssembly" type="TestAssembly.TestClass" alias="TestAlias">
        <permission method="HelloWorld" allowAll="true" />
      </ext>
    </RestExtensions>

    New one (BaseRestExtensions.config):

    <BaseRestExtensions>
        <extension alias="TestAlias" type="TestAssembly.TestClass,TestAssembly">
            <method name="HelloWorld" allowAll="true" />
        </extension>
    </BaseRestExtensions>

    Both are supported with 4.10. But if you're building a new project I'd recommend going with the new one and leaving the old one empty.

    Now, as for attributes: they are another way of declaring your methods, but configuration always go first. So, if your method is described in one of the configuration files, then your attribute is ignored. On the other hand, if you want to configure through attributes, you don't need to put anything in the configuration files. It's one or the other.

    So,

    1. BaseRestExtensions is the new config file for 4.10, resteExtensions is the old one, still supported in 4.10, but will be eventually deprecated

    2. returnXml for GoHome will be true because that's what's in the config file, and because your method is in a config file, its attribute is ignored.

    Hope it helps. Feel free to come back with more questions -- it will help me write a better documentation.

  • Stephen 767 posts 2273 karma points c-trib
    Nov 01, 2012 @ 22:16
    Stephen
    0

    Oh and the code is in Umbraco.Web.BaseRest.

    The code in Umbraco.Web\umbraco.presentation\umbracobase does not run anymore and will be removed eventually.

Please Sign in or register to post replies

Write your reply to:

Draft