[TYPO3-dev] Extbase: translation handling

Cornel Widmer cornel at webstobe.ch
Tue Jul 29 18:15:54 CEST 2014


Hi folks

I really didn't get it how extbase and the repository should work in case of translation handling. Currently working on an extension where each record can be translated and abstracted it is a very simple one.

There are some hotels and some categories. The categories are relationship child-parent and each hotel can have multiple assignments to the category tree.

Now I've setup a frontend-plugin with a flexform in the backend where you can choose wich categories should be displayed. In the controller I fetch this list of categories and query the database trough the repository. For this purpose I wrote a method by myself "findByUids".

In the default language everythings works fine. Then I translate all categories and hotels in the backend and also make a translation of the page and the included content-element. Now the plugin has already the defined categories from the default language (a list of uids).

Now in the frontend no categories are displayed and also not hotels are visible. When I change the uids of the categories in the flexform manually - because I'm not able to change the flexform-query in a proper way to achive that only translated categories are visible - the translated categories are visible.

HOW should this work?

And there is also an other issue: if no categories are selected I want to start with the root categories. So I wrote an other function in my repository -> findRootCategories. Sounds easy. But when this method is called on the translated page EVERY! translated category is returned because in the translated entrys the parent property is set to 0.

public function findRootCategories () {

	// create query object
	$query = $this->createQuery();

	// build query
	$query->matching(
		$query->logicalAnd(
			$query->equals('parent', 0)
		)
	);

	// return result
	return $query->execute();

}

I'm really annoyed by extbase right now. Is there someone who has a proper solution for this problem?

PS: Its possible to give you more code if requested.



More information about the TYPO3-dev mailing list