Extend Base Classes in Typo3

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
mantik
Posts: 89
Joined: 23 Oct 2017, 05:56

Extend Base Classes in Typo3

Post by mantik » 09 Nov 2017, 17:39

in a self developed Extension i use allready a field language but its a integerfield (cause typo3 handles the languages bi integers)

So i Edit Mshop/Common/Item/Base.php and add in the Function checkLanguageId this:

Code: Select all

switch($lang){
case 0:
$langid = 'de'
break;

case 2:
$langid = 'fr'
... etc

}
two questions here:
how can i extend this class and that method so that i dont have to write that in the aimoes extension folder (i will lose it on next update). I have allerady add it to my Extension in src/MShop/Common/Item/base.php

But i must say Typo3 go run this Class there and if you not find a specialy Method run the parent-class :D

Question 2: Can we configure the language so that this code is not needed?

if i dont do that the message :"invalid ISO language..." appears the whole time

User avatar
aimeos
Administrator
Posts: 7873
Joined: 01 Jan 1970, 00:00

Re: Extend Base Classes in Typo3

Post by aimeos » 09 Nov 2017, 22:05

Don't try this that way, it will only lead to numerous problems! In TYPO3 you have to map the sys_language_id to the ISO language code nevertheless to get the product texts in the language of the page. Use TypoScript code like this for the mapping:

Code: Select all

config.language = en
config.sys_language_uid = 0

[globalVar = GP:L = 1]
  config.language = de
  config.sys_language_uid = 1
  plugin.tx_aimeos.settings.client.html.common.format.seperatorDecimal = ,
  plugin.tx_aimeos.settings.client.html.common.format.seperator1000 = .
[global]
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

mantik
Posts: 89
Joined: 23 Oct 2017, 05:56

Re: Extend Base Classes in Typo3

Post by mantik » 14 Nov 2017, 13:33

i do this

Code: Select all

config.language = de
config.sys_language_uid = 0
[globalVar = GP:L = 1]
    config.language = fr
    config.sys_language_uid = 1
[global]
[globalVar = GP:L = 2]
    config.language = it 
    config.sys_language_uid = 2
[global]
but it dosen't change anything.

Output by the clientmodule: Fehler Invalid ISO language code "0"

User avatar
aimeos
Administrator
Posts: 7873
Joined: 01 Jan 1970, 00:00

Re: Extend Base Classes in Typo3

Post by aimeos » 14 Nov 2017, 21:11

Strange. This works perfectly in all other installations. Here's the code that checks for "config.language":
https://github.com/aimeos/aimeos-typo3/ ... le.php#L52
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

mantik
Posts: 89
Joined: 23 Oct 2017, 05:56

Re: Extend Base Classes in Typo3

Post by mantik » 30 Nov 2017, 13:10

And what can i do now?

User avatar
aimeos
Administrator
Posts: 7873
Joined: 01 Jan 1970, 00:00

Re: Extend Base Classes in Typo3

Post by aimeos » 01 Dec 2017, 10:26

What's the URL that leads to that error?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

mantik
Posts: 89
Joined: 23 Oct 2017, 05:56

Re: Extend Base Classes in Typo3

Post by mantik » 01 Dec 2017, 13:00

aimeos wrote:What's the URL that leads to that error?
This happen when i am in the backend and klick on the client module.
The shop is in an intranet. not acesible without login

User avatar
aimeos
Administrator
Posts: 7873
Joined: 01 Jan 1970, 00:00

Re: Extend Base Classes in Typo3

Post by aimeos » 01 Dec 2017, 16:25

If you get this error in the backend, you've overwritten some code in Aimeos or pass the TYPO3 language IDs somewhere directly into the Aimeos classes. Please remove your code or create a clean installation, then the error will be gone.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

mantik
Posts: 89
Joined: 23 Oct 2017, 05:56

Re: Extend Base Classes in Typo3

Post by mantik » 04 Dec 2017, 13:41

I disabled my extension but its still the same.
my users have an field "languages" but its an int.

In your Extension there must be an string

User avatar
aimeos
Administrator
Posts: 7873
Joined: 01 Jan 1970, 00:00

Re: Extend Base Classes in Typo3

Post by aimeos » 04 Dec 2017, 21:58

Please debug here to see if there's the TYPO3 integer value is passed:
https://github.com/aimeos/aimeos-typo3/ ... le.php#L52
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply