BlackbitDigitalCommerce / pimcore-data-director

Import Bundle for Pimcore
16 stars 3 forks source link

Call to a member function getLanguage() on nul #4

Open betterapp opened 2 years ago

betterapp commented 2 years ago

Hello

I try to setup pipe line import. I set up everything like in Your video and when I try to run import I get error:

[2022-01-13 11:20:39] request.CRITICAL: Uncaught PHP Exception Error: "Call to a member function getLanguage() on null" at /.../www/vendor/blackbit/data-director/Controller/RestController.php line 363 {"exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Call to a member function getLanguage() on null at /.../www/vendor/blackbit/data-director/Controller/RestController.php:363)"} []

I use: BDD 2.7.0

BlackbitDevs commented 2 years ago

I have just fixed it and released 2.7.8. But are you sure that the firewall is into place? Because I wonder how you can access the REST API endpoint without a user. Please check your <Pimcore-Root>/config/packages/security.yaml for the point firewalls. It should look like this:

security:
    ...
    firewalls:
        data_director_webservice_short_urls: '%data_director.security.firewalls.webservice_short_urls%'
        data_director_webservice: '%data_director.security.firewalls.webservice%'
        data_director_webservice_documentation: '%data_director.security.firewalls.webservice_documentation%'
        ...
betterapp commented 2 years ago

hmmm I do not have this file - why ? the location You wroted is for PIM >=10. We use 6.9

betterapp commented 2 years ago

also when I click on (+) to install this bundle it show install was successful but the green install button stay. It should change to red (uninstall). image

BlackbitDevs commented 2 years ago

Which Pimcore version are you using? In Pimcore 10 <Pimcore-Root>/config/packages/security.yaml should exist, see https://github.com/pimcore/skeleton/blob/10.x/config/packages/security.yaml. In Pimcore <= 6 it should be app/config/security.yml.

It is normal that the install button stays green. The reason is that in Pimcore 10 there is no plugin update anymore. Executing plugin migrations is only possible by executing bin/console doctrine:migrations:migrate --prefix Blackbit\\DataDirectorBundle - this is on the one hand completely ugly and prone to spelling errors, so I did not want users having to remember this (but of course it still is possible to use this). Moreover above command throws an error if there are no migrations to be executed. This makes automatic deployment complicated. For this reason I decided to extend the pimcore:bundle:install command that it can be used also for updates. For the data director the pimcore:bundle:install command:

betterapp commented 6 months ago

There is no information in documentation about this: Why ?

security:
    firewalls:
        data_director_webservice_short_urls: '%data_director.security.firewalls.webservice_short_urls%'
        data_director_webservice: '%data_director.security.firewalls.webservice%'
        data_director_webservice_documentation: '%data_director.security.firewalls.webservice_documentation%'
betterapp commented 6 months ago

When I try to add it in Pimcore 11 I get error:

Unrecognized option "guard" under "security.firewalls.data_director_webservice_short_urls". Available options are "access_denied_handler", "access_denied_url", "access_token", "context", "custom_authenticators", "entry_point", "form_login", "form_login_ldap", "host", "http_basic", "http_basic_ldap", "json_login", "json_login_ldap", "lazy", "login_link", "login_throttling", "logout", "methods", "pattern", "provider", "remember_me", "remote_user", "request_matcher", "required_badges", "security", "stateless", "switch_user", "two_factor", "user_checker", "x509".