0
votes

I have an extension with an extbase model, which I want to extend. Works fine for all fields, except an "inline" field. When I map that inline field, I do not receive all child elements, but only one child element with the counter as uid.

Example: The inline field "description" has three children (uid = 17, uid = 18, uid = 19), so the field tx_firstextension_domain_model_job.description contains the number 3. In the frontend, I have an ObjectStorage, containing exactly one Description model (uid = 3)

Here is my TypoScript:

config.tx_extbase {
  objects.Foo\FirstExtension\Domain\Model\Job.className = Bar\SecondExtension\Domain\Model\Job
  persistence.classes.Bar\SecondExtension\Domain\Model\Job.mapping {
    table = tx_firstextension_domain_model_job
    columns {
      description.mapOnProperty = description
      anyotherfield.mapOnProperty = anyotherfield
      onemorefield.mapOnProperty = onemorefield
    }
  }
}

SOLUTION

My problem was a wrong configuration option. Correct is tableName, but I used table. Here is the corrected - end even more simple - snippet:

config.tx_extbase {
  objects.Foo\FirstExtension\Domain\Model\Job.className = Bar\SecondExtension\Domain\Model\Job
  persistence.classes.Bar\SecondExtension\Domain\Model\Job.mapping {
    tableName = tx_firstextension_domain_model_job
  }
}
1

1 Answers

0
votes

There seems to be a misconfiguration in your Job-Models configuration. Please check the following:

  1. Is inside the model (Job.php) the property description configured as ObjectStorage (including getter and setter function + annotations correctly) and does the property be instantiated as ObjectStorage in the __construct function?

  2. Is the field correctly configured as type "inline" in the TCA configuration file Configuration/TCA/tx_secondextension_domain_model_job.php

Probably you have to extend the TCA of the first extension in order to make inline work when extending other extensions. Then you maybe have to add the field description to Configuration/TCA/Overrides/tx_firstextension_domain_model_job.php but I'm not sure if this is really necessary...