Comments (12)
The changes will be available in the upcoming 2019.10 releases (ETA: this month)
from aimeos.
A correction: specifying a "URL segment" for each language does work, but only for some languages. I have three languages (de/fr/en) and created a "URL segment" for each of them for "My Product", but only the "de" language works. fr/en still shows a Product "new-name" not found
error.
from aimeos.
What are the records for each language in the mshop_index_text table?
Can you check what happens here in your case:
https://github.com/aimeos/aimeos-core/blob/master/lib/mshoplib/src/MShop/Index/Manager/Text/Standard.php#L681-L736
from aimeos.
That's how the table looks after adding "URL segment" for "All" languages (product not found for all languages):
When I change the "URL segment" from "All" language to "German" (product found on german page, but not on others), the table looks like this:
When I then add the "URL segment" for french and english, nothing changes. The table still looks like on the last picture, and product only shows on german page.
Can you check what happens here in your case:
https://github.com/aimeos/aimeos-core/blob/master/lib/mshoplib/src/MShop/Index/Manager/Text/Standard.php#L681-L736
I'm not very familiar with Aimeos' architecture yet, but I will look into it tomorrow. Anything specific I should look for?
from aimeos.
It might be enough to extend that SQL conditions by
mindte."langid" = $1 OR mindte."langid" IS NULL
in https://github.com/aimeos/aimeos-core/blob/master/lib/mshoplib/src/MShop/Index/Manager/Text/Standard.php#L37
from aimeos.
It might be enough to extend that SQL conditions by
mindte."langid" = $1 OR mindte."langid" IS NULL
After I changed the query, always the first product is shown on the details page. So no luck here.
I investigated further. The problem is, how the URLs are saved. If I create a URL segment for every language, the DB contains exactly the same result, as you see in my second screenshot above. The row with langid=de shows "new-name" as URL. The other languages still have "My_Product" as url.
Changing them manually to "new-name", works. It seems there are two problems:
- By saving a product with custom URL segments (one for every language), only one segment for one language is saved
- Adding a URL segment for "All" languages creates a new row, instead of updating each row for each language (but doing so manually in the DB circumvents the problem)
The bug is where the segments are stored, not where the product is fetched.
from aimeos.
Did you add parenthesis around?
( mindte."langid" = $1 OR mindte."langid" IS NULL )
1.) Can you check again what happens here why only a segment for one language is stored:
https://github.com/aimeos/aimeos-core/blob/master/lib/mshoplib/src/MShop/Index/Manager/Text/Standard.php#L681-L736
2.) That's true. We will implement a way to fix that by removing the old entries afterwards
from aimeos.
Did you add parenthesis around?
( mindte."langid" = $1 OR mindte."langid" IS NULL )
I changed this to ( mindte."langid" = $1 OR mindte."langid" = \'\' )
(because langid is an empty string, not null), which works.
1.) Can you check again what happens here why only a segment for one language is stored:
https://github.com/aimeos/aimeos-core/blob/master/lib/mshoplib/src/MShop/Index/Manager/Text/Standard.php#L681-L736
The problem is, that $item->getRefItems( 'text', 'url', 'default' )
only returns the german (default) language item. I traced it back to https://github.com/aimeos/aimeos-core/blob/master/lib/mshoplib/src/MShop/Common/Item/ListRef/Traits.php#L268
There, $refItem->isAvailable()
returns false, when the langid is not "de".
from aimeos.
OK, but langid
should be null
, so we added that condition: aimeos/aimeos-core@3bbc0f70d
Together with this commit, the products should now be found: aimeos/aimeos-core@1ebb782
getRefItems()
behaves that way because a language ID is set in the context when storing the product in the admin interface. This should fix the problem: aimeos/aimeos-laravel@c40d55c
from aimeos.
Perfect, that fixed both situations explained above. Thank you.
In which release will those changes be available?
from aimeos.
The approach has some flaws, e.g. a new record is created for generic texts (url, name, etc.) but in combination with a full text search the products won't be found.
We use another way now: aimeos/aimeos-core@06711e9
from aimeos.
Old records are now removed too: aimeos/aimeos-core@8595789
from aimeos.
Related Issues (20)
- laminas/laminas-diactoros on clean Laravel 10 HOT 2
- How should I solve such a mistake? HOT 2
- Unable to customize the error messages? HOT 7
- Need to create new route in jqadmin HOT 3
- .jpg files are not get uploaded , showing image type is not supported by GDlib HOT 1
- HTML style attributes not get saved HOT 1
- How can save site details when editing customer detail? HOT 1
- Product detail not reflecting HOT 1
- Shipping Charge HOT 1
- Sorting for sites HOT 1
- No user detail page in subuser login HOT 1
- No item found for conditions: Array ( [locale.site.code] => shop ) HOT 2
- 502 Error when Enabling SHOP_MULTILOCALE and custom domain HOT 13
- Server Error HOT 2
- Error Encountered When Creating a New Account HOT 4
- Delivery Provider is Untriggered Functions HOT 2
- Replace old twitter icon with new icon
- mshop_group tables do not exist HOT 2
- SQLSTATE[42S02]: Base table or view not found: 1146 Table 'aimeos.mshop_index_attribute' doesn't exist HOT 1
- Mysql CA problem HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aimeos.