repository,extbase,findall,typo3-4.5 , findAll on non object in extbase


findAll on non object in extbase

Question:

Tag: repository,extbase,findall,typo3-4.5

I just created an extension in typo3 4.5 with one model (product). I created the "productRepository" then injected it in the ProductController but I still get the

Call to a member function findAll() on a non-object

here is how the ProductController looks like :

/**
 * @var Tx_PiProductDetail_Domain_Repository_ProductRepository
 */
protected $productRepository;

/**
 * @param Tx_PiProductDetail_Domain_Repository_ProductRepository $productRepository
 * @return void
 */
public function injectProductRepository(Tx_PiProductDetail_Domain_Repository_ProductRepository $productRepository) {
    $this->productRepository = $productRepository;
}

/**
 * action list
 *
 * @return void
 */
public function listAction() {
    $products = $this->productRepository->findAll();
    $this->view->assign('products', $products);
}

and the ProductRepository :

class Tx_PiProductDetail_Domain_Repository_ProductRepository extends Tx_Extbase_Persistence_Repository { }

Answer:

This has something to do with the object and reflection caching in Extbase.

In TYPO3 4.5 you should truncate manually all cache related tables in your database. I guess the related tables for the Extbase object and reflection caching are cf_extbase_object, cf_extbase_object_tags, bcf_extbase_reflection and cf_extbase_reflection_tags but I'm not sure.

In TYPO3 4.5 you can avoid the problem while developing by adding this to your typo3conf/localconf.php:

$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['extbase_reflection']['backend'] = 't3lib_cache_backend_NullBackend';
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['extbase_object']['backend'] = 't3lib_cache_backend_NullBackend';

Related:


Symfony2, get locale in repository class


php,symfony2,repository,locale
In my project with symfony2 (2.0) I have a repository class with all querys inside. But in this querys I need the locale (from session?) but inside the repository I can't get this variable (in the controller I havn't any problem) In the repository class I tried this: $request =...

How to turn local source code directory into remote git repo?


git,repository
I have a directory on my Windows machine with some source code that I want to share with a couple of other people to develop it further together. I am thinking of using git, but since I want this repo to be (1) private and (2) free, this seems to...

System.StackOverflowException was unhandled error


c#,asp.net,asp.net-mvc,repository
I am fairly new to repositories and mock repositories, so I would like help understanding what this error means exactly and how to avoid it. I have looked at other posts and done my research but they are too specific to their errors. The code that is breaking is public...

How to add a LIST item with Java API Repository in Oracle ATG?


java,oracle,repository,atg
I create this repository: <gsa-template> <item-descriptor name="indirizzo" > <table name="INDIRIZZO" type="primary" id-column-name="ID_INDIRIZZO"> <property name="via" data-type="string" column-name="VIA" /> <property name="civico" data-type="int" column-name="CIVICO" /> </table> </item-descriptor> <item-descriptor name="utente" > <table name="UTENTE" type="primary" id-column-name="ID_UTENTE"> <property name="nome" data-type="string" column-name="NOME" /> <property...

Entity Framework relationships between different DbContext and different schemas


c#,entity-framework,foreign-keys,repository,dbcontext
So, I have two main objects, Member and Guild. One Member can own a Guild and one Guild can have multiple Members. I have the Members class in a separate DbContext and separate class library. I plan to reuse this class library in multiple projects and to help differentiate, I...

PHP error “Cannot redeclare class” in extbase-based extension of Typo3 4.7


php,typo3,extbase
I have created an extension for Typo3 4.7 (actually, it was created for Typo3 6.2, but I am trying to backport it) using the extbase framework. I have already removed all namespaces from the core and also checked TYPO3 - Call another repository. However, I have the problem that calling...

Adding project directory for git


git,version-control,repository
I have a development server for my php project. The project directory is /var/www/html and i am planning to incorporating git for this development server. I have created a git user and added my local pc's public key to server's .ssh/authorized key location. My question is that where should i...

Saving entity in repository does not work SPRING


java,spring,hibernate,repository,spring-data
I'm trying to save entity in repository but it does not work at all. Repository is Autowired and in runtime I use saveAndFlush to save entity. I'm using PostgreSQL. Above test methods I added comments with explanation what is going on. I expected that method saveAndFlush should work but it...

How does my frontend usergroup list get lost between Extbase action controller and Fluid template partial in TYPO3 6.2?


typo3,fluid,extbase,typo3-6.2.x,typo3-extensions
I'm using TYPO3 CMS 6.2.12 and Extension Builder 6.2.0 to model a Report class and build an extension to manage it. One of the domain driven design requirements is that a report author be a logged-in front end user. A second requirement is that the author choose a single group...

How do I keep GIT repositories inside Dropbox?


git,github,repository,dropbox
So I've seen similar questions asked before, but I'm not thinking about pushing/pulling from a repo on Git's servers, this is just as a place to keep the repo locally on my machines. I'd still push/pull to GitHub. I know it can technically live wherever I want it to, but...

Copy a CVS project into another CVS project


maven,copy,migration,repository,cvs
In our CVS repository our projects look like this: - app-parent - app-backend - app-gui - app-common Now I want to represent the Maven structure of our projects also in our CVS repository. So the repository should then look like this: - app-parent - app-backend - app-gui - app-common How...

Typo3 extbase database query


typo3,extbase,typo3-6.2.x,queryinterface
I have an extbase database query like below. $query = $this->createQuery(); $result = $query->statement("Select * FROM table1 WHERE hidden = 0 AND deleted = 0 AND (".$PublicationYears.") AND logo != '' ORDER BY uid ASC LIMIT 0, ".$iLimit." ")->execute(); return $result; $PublicationYears = "ttra = '12' or ttra = '13'...

create a sub-repository and insert it in the main project


git,github,repository
I'm very new to git, I use it through gitHub, and I wanted to know if there's a way to create a sub-repository that is then included in the main one. For example, if I have a library with modules, I'd like some of them to be in a repository...

How can I render preview of FE plugin diplayed in Page module


typo3,backend,extbase,typo3-6.2.x,typo3-extensions
I have developed TYPO3 (6.2) extensions with some FE plugins. I need to change informations about plugin, which is displayed in the backend on page view. Now only Title and name of plugin is displayed ... I have used flexforms for configure the plugin and I would like to show...

Git: Remove directory with quotes and backslashes from repo


git,directory,repository,special-characters
I have a directory in my git repository (but not on my local system) named "my\\directory-name" It contains two quotation marks and two backslashes. The problem is that with this directory in my repo it is not possible to checkout the contents completely because (error message:) git doesn't find a...

How can I use an injected object in the constructor?


typo3,extbase
I have a service class in my Extbase extension and want to use the ObjectManager to create an instance of an object in the constructor. /** * @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface * @inject */ protected $objectManager; public function __construct() { $this->standaloneView = $this->objectManager->get('TYPO3\CMS\Fluid\View\StandaloneView'); $this->standaloneView->setFormat('html'); } Unfortunately this doesn't fails with an error...

Backup github repository, branches and commits?


github,repository,backup
I want to backup everything including master & other branches & commits on my local & create new repository using different account. Which steps should i follow ? (bundle, mirror or clone)...

can't create files in typo3 inside fileadmin


fopen,extbase,typo3-4.5
I am building an extension with extbase where I need to create a pdf file inside fileadmin folder with php from a controller : fopen("/fileadmin/pdf/anass.pdf", "w") or die('could not create file'); The permission is granted to write files ... so I think I made a mistake writing the path. Could...

Typo3 6.2 fluid pagination not working as expected


typo3,fluid,extbase,typo3-6.2.x,typo3-4.5
My typo3 6.2(Upgraded from Typo3 4.5) fluid paginate displays all the items instead of 5 items. My Repository Method : public function getRandomLocation($iLimit) { $query = $this->createQuery(); $result = $query->statement("Select * FROM tx_sfel_domain_model_ttblocationsproduktegruppen WHERE hidden = 0 AND deleted = 0 AND logo != '' ORDER BY uid LIMIT 0,...

How to use Hook “processDatamap_postProcFieldArray” in TYPO3 6.x


php,typo3,extbase,typo3-6.2.x
Use case: When saving an object (in backend, maybe in frontend too later) I want to manipulate values before saving to database. Problem: The file seems to get included (shows an error on save if I choose a wrong file path) but the function does not seem to be executed...

findAll on non object in extbase


repository,extbase,findall,typo3-4.5
I just created an extension in typo3 4.5 with one model (product). I created the "productRepository" then injected it in the ProductController but I still get the Call to a member function findAll() on a non-object here is how the ProductController looks like : /** * @var Tx_PiProductDetail_Domain_Repository_ProductRepository */ protected...

Spring: Autowired is null in ejb class


spring,ejb,repository,autowired,inject
I have the following situation: @Controller public class myController { @Autowired private IProxy service; public ModelAndView init(HttpServletRequest request, HttpServletResponse response) throws Exception { List<String> list = service.getName(); } } Then my Service is define as follow: public interface IProxy { public List<String> getName(); } Proxy class is responsible for the...

My project uses over 100 git submodules, which submodule alternative can handle a lot of repositories gracefully


git,dependencies,repository,workflow,git-submodules
I've been researching git subtree and other alternatives to git submodules. My project has well over 100 submodules and it's very unwieldy to manage them all. Can anyone recommend a workflow that works really well with a large number of repositories that need to be kept in sync....

Can I return DTO from my repository in some cases?


c#,entity-framework,design-patterns,repository,dto
I have two entities in my "domain assembly". Message - Id - Title - Content - IsMandatoryReading MessageUser - MessageId - UserId // The user who already read the message In my "Infrastructure assembly" I have the MessageRepository with the methods Save, Delete, GetAll, GetMany, FindById etc, all refer the...

Typoscript USER / USER_INT objects in powermail input fields


typoscript,fluid,extbase,typo3-6.2.x
I've a custom extension to render a value from database. I want to prefill the returned value of the extension using powermail prefill typoscript. But when I add the plugin as userfunction, then it will display strange output in frontend. See my typoscript code below; lib.companyname = USER_INT lib.companyname {...

Github App for Mac crashes upon opening


osx,github,crash,repository
Downloaded the Github for Mac app and it crashes instantly upon opening. Here is the error report: Application Specific Information: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Received error from name: in binding for key path "currentActionViewModel" on : NSError { domain: GTGitErrorDomain, code: -12, description: "Failed to...

TYPO3 Extbase build own Sitemap


typo3,sitemap,extbase
There are a lot of sitemap Generators for TYPO3 in the TER available. But none of them can handle Sites created by Extbase, which are not shown in the TYPO3 page tree. Edit Thanks to biesior, detailed informations: Unconventional I switch in TypoScript the GET Parameter for my Extbase extension[globalVar...

How to change git repository using android studio


git,github,android-studio,version-control,repository
I'm using git with android studio and I already sync other repository. But I hope to change a git repository like github. I think I need to disconnect already connected to the repository but I don't found this option. To do that, How can I do?...

Is there a way to use @Query to return a MongoDB $sum result?


spring,mongodb,annotations,repository,aggregation
I'm pretty new to both MongoDB and StackOverflow (as a questioner). I've seen a great response for how to return a MongoDB "count" projection from a Spring repository using the @Query annotation (Count in Spring data mongodb repository). Basically the count example looks like: @Query(value = "{'productDetails.productType': {$regex: ?0, $options:...

Android Studio Best way import module from other repository


android,git,gradle,repository
I have to import a project from a Github repository as a module inside an Android Studio project that it committed into another repository. The project I have to import from Github will be updated constantly so it means that I'll have to refresh every now and again for having...

See git commands generated by TortoiseGit


c#,.net,git,repository,tortoisegit
I use TortoiseGit as my git client. I can cooperate with repository by clicking. I would like to know more about git and its command. Is there any oportunity to see what git commands are generate for git? For example I click Switch command and select target, how can I...

Getting code from my forked repository


git,laravel,repository,laravel-5,composer-php
I made a fork from a repository called "chrisbjr/api-guard". the repository latest version is v2.2.2, and I made a release v2.2.3 from my fork. I have my own branch which is dev-fulluth, to get the code from my fork not from the main repo, composer has to contain the below...

PHP Frameworks and Project Repositories


php,git,github,zend-framework2,repository
I'm starting a new in PHP and for the first time I'm going to use a framework as the basis of the project. I've decided to use Zend Framework 2 for it. I'm going to be version controlling the project via Github. Is it normal to include all the framework...

TYPO3 extbase create url in repository (not controller)


typo3,extbase
There are good tutorials on how to create URL's in the controllers like this one. Examples are: $this->uriBuilder->reset()->setTargetPageUid($page_uid)->setCreateAbsoluteUri(TRUE)->build(); $this->controllerContext->getUriBuilder()->reset()->setTargetPageUid($page_uid)->setArguments(array('person'=>$person->getUid())->buildFrontendUri(); In works from the controller. But I cannot do the same work in a repository. Error log say that reset() in first example and getUriBuilder in second example is called on...

How to get typo3 settings in the utility files?


php,typo3,fluid,extbase
plugin.tx_xxx { setting { storagePid = 23 } } I want this typo3 settings in utility file. Please help me....

How to get filename in Typo3 solr extension with FAL and own Extbase extension


solr,typo3,extbase,typo3-6.2.x,fal
Before FAL, I can get the filename of an image from my own Extbase extension in the solr config file "typo3/ext/solr/Configuration/TypoScript/Solr/setup.txt" via index { queue { tx_myextension = 1 tx_myextension { fields { ... myimage_stringS = articleimage ... } } } } Where "articleimage" was a database field with the...

Autofac Repository Pattern and Unit Of Work


entity-framework,design-patterns,repository,autofac,unit-of-work
I have searched a little bit and I am confused. First Approach uses a repository and a service for each entity with Autofac. Unit of work class does not have repositories. Therefore, you should create each repository instead of just creating one unit of work class in caller constructor. OrderService(IUnitOfWork...

Trying to access Oracle's Maven repository


oracle,maven,repository
I'm attempting to access Oracle's repository. Oracle doesn't make it easy. However, I'm attempting to follow the documentation that Oracle provided. I've: Approved the licensing agreement on my system (in case there's some sort of cookie that needs to be set). Set both M2_HOME and MAVEN_HOME to /usr/share/apache-maven. Created an...

how can i get repository of many entities in one getRepository


symfony2,repository,entity
I have tried this but it wont work it just execute the first entity $resultat = $con->getRepository("PFESiivtBundle:Categorie","PFESiivtBundle:Evenement", "PFESiivtBundle:Projet")->findBy(array('idPublication' =>$respub),array('id'=>'DESC') ); ...

What urpmi source can I use with Mandriva Entreprise Server 5.2?


linux,repository,server
I have to install several packages for a customer on an old server using Mandriva Entreprise Server 5.2 (MES5). I have asked my customer for the DVD-ROM but he didn't find it, so I would like to know if there is an online compatible repository. I have found several repositories...

How to rename a remote git branch name


git,repository,rename,git-branch
I have 4 braches like master -> origin/regacy, FeatureA -> origin/FeatureA. As you can see above, I typed a wrong name. So I want to rename a remote branch name ( origin/regacy => origin/legacy or origin/master) I try to command below. git remote rename regacy legacy But git console retured...

getting a repository for projects


repository
When I was on an army programming course me and my friends used SVN with a repository we had. I wanna set up a repository so that I can work on my projects without having to worry about moving my files from pc to pc and working with the right...

Display Extbase FileReference with Fluid


typo3,fluid,extbase,typo3-6.2.x
In an extbase extension, I have a FileReference Object. It was created with extension_builder originally. From The Model: /** * apprenticeshipDocument * @var \TYPO3\CMS\Extbase\Domain\Model\FileReference */ protected $apprenticeshipDocument = NULL; etc. In the frontend, <f:debug>{institution.apprenticeshipDocument}</f:debug> gives me this: First Thing: originalResource is missing. Second: When calling {institution.apprenticeshipDocument.uidLocal} directly, the value is...

need more understanding on gitblit groovy push script


java,git,groovy,repository,gitblit
I have below groovy script PushCommand push=git.push(); push.setRemote("my remote"); push.setPushAll(); //Push all branches under refs/heads/*. push.setForce(true); //Sets the force preference for push operation. push.call(); My requirement: want to push only changes from one gitinstance to other setPushAll : Is this going to push all repository data all time script executed...

How to disable cache for a image carousel in TYPO3


caching,typo3,typoscript,extbase,typo3-6.2.x
My TYPO3 extension has a lib that generates random 5 images from the total stock, for example out of the 100 images. This is done randomly every time the page is loaded. Only default the TYPO3 cache is enabled so every time the same 5 images are showed. As the...

Maven failure to find codehaus artifact org.codehaus:codehaus-parent


java,maven,groovy,repository
So codehaus shut down (over the weekend, apparently): https://www.codehaus.org/ Now it says here that "Maven: All repositories are mirrored into Central, and our Nexus is hosted by Sonatype". If I am reading this correctly, this means that it should continue to work (and because Central is the default repository, I...

Mock service that takes unitOfWork in constructor


c#,unit-testing,repository,moq,business-logic
I try to write unit tests on my business logic. What i have now : private Mock<IRepository<Theme>> _mockRepository; private IBaseService<Theme> _service; private Mock<IAdminDataContext> _mockDataContext; private List<Theme> _listTheme; [TestInitialize] public void Initialize() { _mockRepository = new Mock<IRepository<Theme>>(); _mockDataContext = new Mock<IAdminDataContext>(); _service = new ThemeService(_mockDataContext.Object); _listTheme = new List<Theme> { new...

Does gitignore support regexp


linux,git,repository
How to make $HOME/.gitignore understand regexp? Specifically, I want to enable it ignore files modules.builtin and modules.order: modules.\(order\|builtin) This doesn't seem to be picked up when I'm running git status What am I doing wrong here? Thanks....

Using FAL in Extbase correctly


typo3,extbase,fal
Domain model class Image extends AbstractContent { /** * @var \TYPO3\CMS\Extbase\Domain\Model\FileReference */ protected $file; /** * Gets the image file * * @return \TYPO3\CMS\Extbase\Domain\Model\FileReference */ public function getFile() { return $this->file; } /** * Sets the image file * * @param \TYPO3\CMS\Extbase\Domain\Model\FileReference $file * @return void */ public function setFile($file)...