Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Argument #1 ($id) must be of type string, int given #416

Open
paulverdu opened this issue Aug 4, 2024 · 10 comments
Open

Argument #1 ($id) must be of type string, int given #416

paulverdu opened this issue Aug 4, 2024 · 10 comments

Comments

@paulverdu
Copy link
Contributor

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?

@paulverdu
Copy link
Contributor Author

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?

@paulverdu
Copy link
Contributor Author

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.

@dpfaffenbauer
Copy link
Collaborator

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.

@paulverdu
Copy link
Contributor Author

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

@paulverdu
Copy link
Contributor Author

paulverdu commented Aug 4, 2024

Hmm i see something went wrong pulling those latest 5.1 changes

@paulverdu
Copy link
Contributor Author

paulverdu commented Aug 4, 2024

@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?

@paulverdu
Copy link
Contributor Author

Unfortunately it is still broken. Even when changing the yaml as described above. Am I still doing something wrong here?

@paulverdu paulverdu reopened this Aug 4, 2024
@dpfaffenbauer
Copy link
Collaborator

I will check next week when I am in office ok

@paulverdu
Copy link
Contributor Author

paulverdu commented Aug 4, 2024

Yeah sure! No problem. Thanks :)

Have a nice weekend

@dpfaffenbauer
Copy link
Collaborator

@paulverdu can you try this #417

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants