Multilingual field sorting sometimes doesn't work

2 views
Skip to first unread message

Alexander Obuhovich

unread,
Nov 9, 2009, 9:00:20 AM11/9/09
to in-port...@googlegroups.com
I have one language installed, e.g. "English" (id = 1). Then I create several products (because their name/description is multilingual). Then in database I could verify, that such products have values in "l1_Name", "l1_Description" fields, but doesn't have values inside "l2_Name", "l2_Description" fields, because I don't have language with ID = 2 yet.

I add new language to the site, e.g. "Russian" (id = 2). Products I've created still have empty values for "l2_*" fields, because kMultiLanguage formatter class will automatically show values from l1_* fields, when requested l2_* field value is missing.

When I try to sort products in category on Front-End, when I'm on Russian language (id = 2), then it doesn't sort, because l2_* fields for products created before "Russian" language was added is empty.

I propose we use same kind of functionality for multilingual field ordering as kMultiLanguage formatter class: sort value on current language, when present, but when not present, then sort value in primary language.

--
Best Regards,

http://www.in-portal.org
http://www.alex-time.com

Dmitry

unread,
Nov 9, 2009, 11:24:50 AM11/9/09
to in-port...@googlegroups.com
Yes, I think we saw this behavior earlier, but weren't sure about the source of the problem.

Just wanted to check how this can be implemented? Adding 2 ORDER BYs ( l2_ and l1_ )? In some cases one record (new) can have l2_ populated and old records have it empty. How do we go about this one?


-- 


--
Best Regards,

Dmitry V. Andrejev

Alexander Obuhovich

unread,
Nov 9, 2009, 1:21:27 PM11/9/09
to in-port...@googlegroups.com
I've made a patch already, but forgot to attach it in my first post. I've attached it now. Two order by fields will only raise problems in case if fields in both languages are filled. Related to new record this is only the case, when you have products in database and you add new language and make it primary. In this case all products become invalid.

When primary language is changed, then we could copy values (for all tables) from old primary language fields to new primary language fields in case if they are missing in new primary language fields. This way required multilingual fields will be filled and all items will be valid.
ml_field_sorting_problem.patch

Dmitry

unread,
Nov 9, 2009, 1:27:42 PM11/9/09
to in-port...@googlegroups.com
Yes, I think this is the case - we definitely need to copy all values in all ML fields from OLD Primary to NEW Primary for missing ones.

How do we find missing ones - IS NOT NULL?

Do we have a bug in Issue Tracker for this yet?

Alexander Obuhovich

unread,
Nov 9, 2009, 1:29:41 PM11/9/09
to in-port...@googlegroups.com
Both variants will work, but COALESCE(Field, '') = '' will find all empty values.

Phil

unread,
Nov 16, 2009, 7:22:52 PM11/16/09
to In-Portal Bugs
Hi guys,

the idea to copy all values from one language to another could be the
right one, but it could also mask a global problem dealing with lang
pack. I had another issue of the same type as follow:

I installed a fresh 501, and uploaded the french lang pack. After
setup French as primary lang for admin and front-end, I started to
create my first category.
I had an error message when I tried to save it, and I noticed in the
top right corner of the category window that I was sticked on
"english", and even after changing the value in drop down, it was
coming back to English. I closed the category editing window, and
changed the top right lang selector to choose french langage.
After this change, the category creation were going fine, but I
discovered that the catalog tree wasn't showing sections anymore.
Dmitry had a quick look and found that it's because english value were
still used to display tree names, while admin interface is in French
(as related in http://tracker.in-portal.org/view.php?id=349 )

Cheers
Phil.

On Nov 9, 7:27 pm, Dmitry <dandre...@gmail.com> wrote:
> Yes, I think this is the case - we definitely need to copy all values in
> all ML fields from OLD Primary to NEW Primary for missing ones.
>
> How do we find missing ones - IS NOT NULL?
>
> Do we have a bug in Issue Tracker for this yet?
> --
>
> --
> Best Regards,
>
> Dmitry V. Andrejev
>
> -----Original Message-----
> From: Alexander Obuhovich <aik.b...@gmail.com>
>
> Reply-To: in-port...@googlegroups.com
> To: in-port...@googlegroups.com
> Subject: Re: Multilingual field sorting sometimes doesn't work
> Date: Mon, 9 Nov 2009 20:21:27 +0200
>
> I've made a patch already, but forgot to attach it in my first post.
> I've attached it now. Two order by fields will only raise problems in
> case if fields in both languages are filled. Related to new record this
> is only the case, when you have products in database and you add new
> language and make it primary. In this case all products become invalid.
>
> When primary language is changed, then we could copy values (for all
> tables) from old primary language fields to new primary language fields
> in case if they are missing in new primary language fields. This way
> required multilingual fields will be filled and all items will be valid.
>

Dmitry A.

unread,
Nov 18, 2009, 1:46:06 PM11/18/09
to In-Portal Bugs
Hello everyone,


We have recently attached a new patch that should be addressing this
issue.

http://tracker.in-portal.org/view.php?id=349

Phil and other members of Community are welcome to test this on your
5.0.1 versions.


Let test and report in the task and here.

Thanks.
> >http://www.in-portal.orghttp://www.alex-time.com- Hide quoted text -
>
> - Show quoted text -

Alexander Obuhovich

unread,
Nov 18, 2009, 1:48:27 PM11/18/09
to in-port...@googlegroups.com
You should also add AdminLanguage column to PortalUser table (see core/install/upgrades.sql for details). This is only for case, when re-install is not made.


--

You received this message because you are subscribed to the Google Groups "In-Portal Bugs" group.
To post to this group, send email to in-port...@googlegroups.com.
To unsubscribe from this group, send email to in-portal-bug...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/in-portal-bugs?hl=en.


Alexander Obuhovich

unread,
Sep 12, 2010, 2:13:54 PM9/12/10
to in-port...@googlegroups.com
I've found, that we've forgot to create task related to initial post at this discussion:
http://tracker.in-portal.org/view.php?id=859

Ready for testing.
--
Best Regards,

http://www.in-portal.com
http://www.alex-time.com

Dmitry A.

unread,
Sep 12, 2010, 9:20:36 PM9/12/10
to In-Portal Bugs Team
Thanks for NOT forgetting this one, Alex!

Tested and ready to be committed.

DA

On Sep 12, 1:13 pm, Alexander Obuhovich <aik.b...@gmail.com> wrote:
> I've found, that we've forgot to create task related to initial post at this
> discussion:http://tracker.in-portal.org/view.php?id=859
>
> Ready for testing.
>
> On Wed, Nov 18, 2009 at 9:48 PM, Alexander Obuhovich <aik.b...@gmail.com>wrote:
>
>
>
>
>
> > You should also add AdminLanguage column to PortalUser table (see
> > core/install/upgrades.sql for details). This is only for case, when
> > re-install is not made.
>
> >> > >http://www.in-portal.orghttp://www.alex-time.com-Hide quoted text -
>
> >> > - Show quoted text -
>
> >> --
>
> >> You received this message because you are subscribed to the Google Groups
> >> "In-Portal Bugs" group.
> >> To post to this group, send email to in-port...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> in-portal-bug...@googlegroups.com<in-portal-bugs%2Bunsubscribe@go oglegroups.com>
> >> .
Reply all
Reply to author
Forward
0 new messages