[TYPO3-mvc] 6.2 Strange Bug with Repository Remove: Insists on wrong object type?

g4-lisz at tonarchiv.ch g4-lisz at tonarchiv.ch
Fri Sep 26 22:57:03 CEST 2014


On 09/26/2014 10:14 PM, g4-lisz at tonarchiv.ch wrote:
> Hi all
>
> I want to get ready with some old extension for 6.2, but there's one
> issue driving me crazy:
>
> In my deleteAction, I pass the right object, but I always get the error:
> #1248363336: The object given to remove() was not of the type
> (Tx_Hplusinfo_Domain_Model_Anfahrtsdokument) this repository manages.
>
> My deleteAction looks like this:
>
>         /**
>          * Delete Anfahrtsdokument
>          * @param Tx_Hplusinfo_Domain_Model_Anfahrtsdokument
> $anfahrtsdokument
>          **/
>         public function
> anfahrtsdokumentDeleteAction(Tx_Hplusinfo_Domain_Model_Anfahrtsdokument
> $anfahrtsdokument) {
>               echo get_class ($anfahrtsdokument);
>
>               $this->anfahrtsdokumentRepository->remove(anfahrtsdokument);
>        }
>
> get_class says: "Tx_Hplusinfo_Domain_Model_Anfahrtsdokument"
>
> So that's exactly what the repository wants.
>
> What I am missing here?
>
> TYPO3 is V6.2.4
>
> Cheers,
> Till
It's getting even more spooky... I added some debuging to
Extbase\Persistence\Repository

        public function remove($object) {
                if (!$object instanceof $this->objectType) {

                        throw new
\TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException('The
object given to remove() ("'.get_class($object).'") was not of the type
(' . $this->objectType . ') this repository manages.', 1248363336);
                }
                $this->persistenceManager->remove($object);
        }

Now I get this: "PHP Warning: get_class() expects parameter 1 to be
object, string given"
Why is this a string??

BR
Till



More information about the TYPO3-project-typo3v4mvc mailing list