pimcore-data-definitions
pimcore-data-definitions copied to clipboard
Argument #1 ($id) must be of type string, int given
| Q | A |
|---|---|
| Bug report? | yes |
| Feature request? | no |
| BC Break report? | no |
| RFC? | yes |
| Branch? | 5.1 |
I keep getting the following error. Even when updating to the newest 5.1 tag.
Instride\Bundle\DataDefinitionsBundle\Model\ImportDefinition\Dao::getById(): Argument #1 ($id) must be of type string, int given, called in /Users/paulverdu/Dev
elopment/emico/vivara/vendor/instride/data-definitions/src/DataDefinitionsBundle/Model/ImportDefinition/Dao.php on line 101
I don't understand why the method getById still required a string for $id value when $id is clearly an integer. Am I missing something here or is it just really broken right now?
Also the method getDataByName from vendor/pimcore/pimcore/lib/Model/Dao/PimcoreLocationAwareConfigDao.php called within the getById method is requiring a string $id. Why is this method getting the id as string when the method is called getDataByName?
The command data-definitions:import clearly states that the parameter -d can be the ID or name, but when executing it with an id integer (2) the error Import Definition with Name "2" does not exist. is presented.
And when executing it with a name string (SuperGroupsAndGroups) the error Argument #1 ($id) must be of type string, int given is presented.
Please see the release notes for 5.1: https://github.com/instride-ch/pimcore-data-definitions/releases. We f**** something up in 5.0 which we fixed now. We know this is a BC break, but it is worth it.
Hi @dpfaffenbauer, i did these changes. I renamed my yaml files to 1.yaml, 2.yaml etc. Change the name in the definitions files to 1 and 2 and also added id: 1 and id: 2. But these errors still occur.
1.yaml:
data_definitions:
import_definitions:
1:
id: 1
name: SuperGroupsAndGroups
provider: csv
class: Group
configuration:
csvExample: 'superGroupName,superGroupCode,groupName,groupCode,subGroupCodes'
delimiter: ','
enclosure: '"'
csvHeaders: null
Hmm i see something went wrong pulling those latest 5.1 changes
@dpfaffenbauer I see there is only a 5.1 tag and a 5.0 branch. Are these 5.1 changes gonna be merged in a master or main branch?
Unfortunately it is still broken. Even when changing the yaml as described above. Am I still doing something wrong here?
I will check next week when I am in office ok
Yeah sure! No problem. Thanks :)
Have a nice weekend
@paulverdu can you try this https://github.com/instride-ch/pimcore-data-definitions/pull/417
ID's are implemented again like before, so closing this issue