Scheduler problem
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Re: Scheduler problem
The "Aimeos advanced scheduler task" is required e.g. for the product links in the e-mails and the sitemap.
Can you post your site configuration?
Can you post your site configuration?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Posts: 9
- Joined: 08 Jan 2020, 15:21
Re: Scheduler problem
Too bad, that's quite an important task haha
Site config in typo3/sites/lba/config.yaml
This is my site configuration for the root page and the only one, I have no other root page or site configuration.
----- Begin----
base: 'https://www.productionexample.com/'
baseVariants:
-
base: 'https://localhost10/'
condition: 'applicationContext == "Development"'
errorHandling: { }
languages:
-
title: Deutsch
enabled: true
base: /
typo3Language: de
locale: de_DE.UTF-8
iso-639-1: de
navigationTitle: Deutsch
hreflang: de-DE
direction: ''
flag: de
languageId: '0'
rootPageId: 1
routeEnhancers:
AimeosList:
type: Extbase
namespace: ai
limitToPages:
- 36
routes:
-
routePath: /
_controller: 'Catalog::list'
-
routePath: '/{f_name}~{f_catid}'
_controller: 'Catalog::list'
-
routePath: '/{f_name}~{f_catid}'
_controller: 'Catalog::tree'
AimeosDetail:
type: Extbase
namespace: ai
limitToPages:
- 44
routes:
-
routePath: '/{d_name}'
_controller: 'Catalog::detail'
-
routePath: '/{d_name}/d/{d_prodid}'
_controller: 'Catalog::detail'
-
routePath: '/pin/{pin_action}/{pin_id}/{d_name}'
_controller: 'Catalog::detail'
defaults:
d_pos: ''
AimeosBasket:
type: Extbase
namespace: ai
limitToPages:
- 43
routes:
-
routePath: /
_controller: 'Basket::index'
-
routePath: /{b_action}
_controller: 'Basket::index'
AimeosCheckout:
type: Extbase
namespace: ai
limitToPages:
- 42
routes:
-
routePath: /
_controller: 'Checkout::index'
-
routePath: /{c_step}
_controller: 'Checkout::index'
AimeosConfirm:
type: Simple
limitToPages:
- 41
routePath: /{code}
AimeosProfile:
type: Extbase
namespace: ai
limitToPages:
- 34
routes:
-
routePath: /
_controller: 'Account::index'
-
routePath: /
_controller: 'Account::watch'
-
routePath: /
_controller: 'Account::favorite'
-
routePath: /watch/{wat_action}
_controller: 'Account::watch'
-
routePath: /watch/{wat_action}/{wat_id}
_controller: 'Account::watch'
-
routePath: /fav/{fav_action}
_controller: 'Account::favorite'
-
routePath: /fav/{fav_action}/{fav_id}
_controller: 'Account::favorite'
-
routePath: /history/{his_action}/{his_id}
_controller: 'Account::history'
routes: { }
----- End----
I also attached my page tree. the shortcut of the root page links to Home. (Just for testing all simple solutions I already moved the Shap page tree below Home, but this didn't work)
I didn't post my Aimeos and php version, sorry for that.
Aimeos 19.10.1, Typo3 9.5.11, PHP 7.2.1, testserver Wamp.
While I was looking up the version of Aimeos I realized there are 2 further updates, maybe they will solve something, I should have checked that earlier, but I'm currently working on an offline system due to a new system setup. I will try if the updates change something.
If anything else would be helpful I can provide that. Thank you for your help.
Site config in typo3/sites/lba/config.yaml
This is my site configuration for the root page and the only one, I have no other root page or site configuration.
----- Begin----
base: 'https://www.productionexample.com/'
baseVariants:
-
base: 'https://localhost10/'
condition: 'applicationContext == "Development"'
errorHandling: { }
languages:
-
title: Deutsch
enabled: true
base: /
typo3Language: de
locale: de_DE.UTF-8
iso-639-1: de
navigationTitle: Deutsch
hreflang: de-DE
direction: ''
flag: de
languageId: '0'
rootPageId: 1
routeEnhancers:
AimeosList:
type: Extbase
namespace: ai
limitToPages:
- 36
routes:
-
routePath: /
_controller: 'Catalog::list'
-
routePath: '/{f_name}~{f_catid}'
_controller: 'Catalog::list'
-
routePath: '/{f_name}~{f_catid}'
_controller: 'Catalog::tree'
AimeosDetail:
type: Extbase
namespace: ai
limitToPages:
- 44
routes:
-
routePath: '/{d_name}'
_controller: 'Catalog::detail'
-
routePath: '/{d_name}/d/{d_prodid}'
_controller: 'Catalog::detail'
-
routePath: '/pin/{pin_action}/{pin_id}/{d_name}'
_controller: 'Catalog::detail'
defaults:
d_pos: ''
AimeosBasket:
type: Extbase
namespace: ai
limitToPages:
- 43
routes:
-
routePath: /
_controller: 'Basket::index'
-
routePath: /{b_action}
_controller: 'Basket::index'
AimeosCheckout:
type: Extbase
namespace: ai
limitToPages:
- 42
routes:
-
routePath: /
_controller: 'Checkout::index'
-
routePath: /{c_step}
_controller: 'Checkout::index'
AimeosConfirm:
type: Simple
limitToPages:
- 41
routePath: /{code}
AimeosProfile:
type: Extbase
namespace: ai
limitToPages:
- 34
routes:
-
routePath: /
_controller: 'Account::index'
-
routePath: /
_controller: 'Account::watch'
-
routePath: /
_controller: 'Account::favorite'
-
routePath: /watch/{wat_action}
_controller: 'Account::watch'
-
routePath: /watch/{wat_action}/{wat_id}
_controller: 'Account::watch'
-
routePath: /fav/{fav_action}
_controller: 'Account::favorite'
-
routePath: /fav/{fav_action}/{fav_id}
_controller: 'Account::favorite'
-
routePath: /history/{his_action}/{his_id}
_controller: 'Account::history'
routes: { }
----- End----
I also attached my page tree. the shortcut of the root page links to Home. (Just for testing all simple solutions I already moved the Shap page tree below Home, but this didn't work)
I didn't post my Aimeos and php version, sorry for that.
Aimeos 19.10.1, Typo3 9.5.11, PHP 7.2.1, testserver Wamp.
While I was looking up the version of Aimeos I realized there are 2 further updates, maybe they will solve something, I should have checked that earlier, but I'm currently working on an offline system due to a new system setup. I will try if the updates change something.
If anything else would be helpful I can provide that. Thank you for your help.
- Attachments
-
- Page Tree
- Screenshot-2020-1-10 Backend [TYPO3 CMS 9 5 11].png (40.49 KiB) Viewed 3702 times
-
- Posts: 9
- Joined: 08 Jan 2020, 15:21
Re: Scheduler problem
As the indentation of the configuration was destroyed in my post, here the original file inside the zip container
- Attachments
-
- config.zip
- (758 Bytes) Downloaded 183 times
-
- Posts: 9
- Joined: 08 Jan 2020, 15:21
Re: Scheduler problem
I did a quick update now and checked the advanced task as well as the frontend sort funcionality, unfortunately it still doesn't work.
Re: Scheduler problem
Here's the relavant site configuration for our test environment:
The only notable difference is
in the languages section ("/" in your config)
Code: Select all
rootPageId: 1
base: 'http://127.0.0.1:8000/'
baseVariants: { }
languages:
-
title: Home
enabled: true
languageId: '0'
base: 'http://127.0.0.1:8000/'
typo3Language: default
locale: en_US.UTF-8
iso-639-1: en
navigationTitle: ''
hreflang: ''
direction: ''
flag: global
errorHandling: { }
Code: Select all
base: 'http://127.0.0.1:8000/'
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Posts: 9
- Joined: 08 Jan 2020, 15:21
Re: Scheduler problem
I really don't know, I tried it with your exact site configuration but everything except the advanced task works. I guess I will do a complete new installation of typo3 and aimeos and see if something changes and as soon as my new system is setup I try it on production server, maybe it is something with the wamp server setup. I'm sure the issue will disappear at some point
Thank you very much for your answers and also for such a great shop system extension!!!
Thank you very much for your answers and also for such a great shop system extension!!!
-
- Posts: 9
- Joined: 08 Jan 2020, 15:21
Re: Scheduler problem
Hey there,
I debugged the code a bit deeper and found out that the error is thrown by a deprecated typo3 function.
aimeos/Classes/Scheduler/Base.php calls
This still works, but then it calls
and this always returns null, debugging a bit deeper showed that firstDomainRecord() is deprecated since typo 3 9.4 and therefore the LegacyDomainResolver handles this. In here the matchRootPageId always returns null, it seems like it doesn't event get called correctly and I didn't find a good solution in here.
Therefore I changed the code of aimeos/Classes/Scheduler/Base.php to the following:
I added
and replaced
with
Explanation:
I set the host variable to null. then I loop through the $GLOBALS['TSFE']->rootLine array and check for the first page which is a root page. Then I use site finder to get the domain from the related site configuration and set the host variable to the domain.
If I now debug the last variable in that funciton $_SERVER['HTTP_HOST']
this has the following results:
if the site configuration has an entry point the $_SERVER['HTTP_HOST'] variable is
Can you tell me if this is the correct behaviour/variable result?
From that point on the error disappears and e.g. a sitemap file is generated with urls (in the normal scheudler task it was without urls). The urls in the sitemap however are not the realURLs, they are followed by e.g.
Is this the expected behaviour? Do search engines (google,etc.) then index this "ugly" url or do they resolve it to the realURL?
And in the scheudler task typoscript configuration I added ...sitemap/location and ...sitemap/baseurl. Am I correct, that I have to set an additional routeEnhancer to make this page accessible because it doesn't work out of the box.
So far I think I got way closer to get everything setup correctly.
Thanks for any answers
I debugged the code a bit deeper and found out that the error is thrown by a deprecated typo3 function.
aimeos/Classes/Scheduler/Base.php calls
Code: Select all
$rootline = BackendUtility::BEgetRootLine( $pageid );
Code: Select all
$host = BackendUtility::firstDomainRecord( $rootline );
Therefore I changed the code of aimeos/Classes/Scheduler/Base.php to the following:
I added
Code: Select all
use TYPO3\CMS\Core\Site\SiteFinder;
Code: Select all
$rootline = BackendUtility::BEgetRootLine( $pageid );
$host = BackendUtility::firstDomainRecord( $rootline );
Code: Select all
$host = null;
foreach ($GLOBALS['TSFE']->rootLine as $row) {
if ($row['is_siteroot'] === 1) {
$domain = GeneralUtility::makeInstance(SiteFinder::class)
->getSiteByRootPageId($row['uid'])
->getBase()
->getHost();
$host = rtrim($domain, '/');
break;
}
}
I set the host variable to null. then I loop through the $GLOBALS['TSFE']->rootLine array and check for the first page which is a root page. Then I use site finder to get the domain from the related site configuration and set the host variable to the domain.
If I now debug the last variable in that funciton $_SERVER['HTTP_HOST']
Code: Select all
$_SERVER['HTTP_HOST'] = $host;
if the site configuration has an entry point
Code: Select all
https://www.example.com/ or https://localhost10/
Code: Select all
www.example.com or localhost10
From that point on the error disappears and e.g. a sitemap file is generated with urls (in the normal scheudler task it was without urls). The urls in the sitemap however are not the realURLs, they are followed by e.g.
Code: Select all
?ai%5Bd_name%5D=Demo_article&ai%5Bd_pos%5D=&ai%5Bcontroller%5D=Catalog&ai%5Baction%5D=detail
And in the scheudler task typoscript configuration I added ...sitemap/location and ...sitemap/baseurl. Am I correct, that I have to set an additional routeEnhancer to make this page accessible because it doesn't work out of the box.
So far I think I got way closer to get everything setup correctly.
Thanks for any answers
Re: Scheduler problem
Thank you for digging through the TYPO3 code!
In the meantime, we also had a response from one of the TYPO3 developers regarding the issue. He suggested to use the SiteFinder class too:
Maybe that code would also generate URLs using the router enhancer rules.
Just for curiosity: Did you create a domain record in the root page (list view of the page with the globe)?
In the meantime, we also had a response from one of the TYPO3 developers regarding the issue. He suggested to use the SiteFinder class too:
Code: Select all
$site = GeneralUtility::makeInstance(SiteFinder::class)->getSiteByPageId($pageId);
$site->getRouter()->generateUri($pageId, ['my-argument' => 13]);
Just for curiosity: Did you create a domain record in the root page (list view of the page with the globe)?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Posts: 9
- Joined: 08 Jan 2020, 15:21
Re: Scheduler problem
Sure, that's the least I can do. Thank you for taking the time for support.
Haha cool thing, I read closer about it here https://docs.typo3.org/m/typo3/referenc ... ation.html and was so caught up with getSiteByRootPageId that I didn't read closer about getSiteByPageId which is faster, cleaner and better.
I now replaced the original with
The second Line of your code is cool, but I don't know where this should go, however using this one here above now already creates realURL in the sitemap
So I guess I have no more questions on that, if I don't encounter further errors, the problem is now solved entirely, thanks for so much help.
Now after all of that I answer your last question, of course I ... didn't. At the end of the day you forgot an obvious configuration step that was so obvious that you simply didn't recognize it anymore. Sorry for causing such a long conversation and time, this solves the problem again.
So now the problem was solved twice with one support answer => genius support answer
Thanks a lot
Haha cool thing, I read closer about it here https://docs.typo3.org/m/typo3/referenc ... ation.html and was so caught up with getSiteByRootPageId that I didn't read closer about getSiteByPageId which is faster, cleaner and better.
I now replaced the original
Code: Select all
$rootline = BackendUtility::BEgetRootLine( $pageid );
$host = BackendUtility::firstDomainRecord( $rootline );
Code: Select all
$host = GeneralUtility::makeInstance(SiteFinder::class)->getSiteByPageId($pageId)->getBase()->getHost();
So I guess I have no more questions on that, if I don't encounter further errors, the problem is now solved entirely, thanks for so much help.
Now after all of that I answer your last question, of course I ... didn't. At the end of the day you forgot an obvious configuration step that was so obvious that you simply didn't recognize it anymore. Sorry for causing such a long conversation and time, this solves the problem again.
So now the problem was solved twice with one support answer => genius support answer
Thanks a lot
Re: Scheduler problem
@GGamingStudioRespect Which Aimeos version are you using?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star