coreshop / CoreShop

CoreShop - Pimcore enhanced eCommerce
http://www.coreshop.org
Other
277 stars 158 forks source link

PimCore 11.2.2 and CoreShop 4.0.5, can't open CoreShopCustomer and CoreShopCompany class definition in backend #2605

Closed JustMe69 closed 7 months ago

JustMe69 commented 7 months ago
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? yes/no

pimcore 11.2.2 and coreshop 4.0.5 installed

When I try to open the class-definitioons (dataobjects - classes) and try to open CoreSHopCustomer and/or CoreShopCompany clas I get following error and the defiition doesn't open:

script-proxy?storage…db79d95691ebb:51330 Uncaught TypeError: Cannot read properties of undefined (reading 'prototype')
    at constructor.addDataChild (script-proxy?storage…9d95691ebb:51330:56)
    at klass.recursiveAddNode (script-proxy?storage…9d95691ebb:50288:19)
    at klass.recursiveAddNode (script-proxy?storage…9d95691ebb:50292:22)
    at klass.recursiveAddNode (script-proxy?storage…9d95691ebb:50292:22)
    at klass.initLayoutFields (script-proxy?storage…9d95691ebb:50268:62)
    at klass.initialize (script-proxy?storage…9d95691ebb:50103:14)
    at new klass (class.js?_dc=71e2ff0…db79d95691ebb:33:29)
    at klass.addClassPanel (script-proxy?storage…9d95691ebb:51810:26)
    at Object.callback (ext-all.js?_dc=71e2f…9d95691ebb:1827:134)
    at constructor.onComplete (ext-all.js?_dc=71e2f…79d95691ebb:2655:25)

I tried to reinstall all class-definitions with

php bin/console pimcore:deployment:classes-rebuild -d
 php bin/console pimcore:deployment:classes-rebuild -c

no change

All other CoreShop-classes can be opened and edited. Only these 2 classes show this error!

my bundles.php with activated pimcore plugins:

    \Pimcore\Bundle\ApplicationLoggerBundle\PimcoreApplicationLoggerBundle::class => ['all' => true],
    \Pimcore\Bundle\GlossaryBundle\PimcoreGlossaryBundle::class => ['all' => true],
    \Pimcore\Bundle\TinymceBundle\PimcoreTinymceBundle::class => ['all' => true],
    \Pimcore\Bundle\StaticRoutesBundle\PimcoreStaticRoutesBundle::class => ['all' => true],
    \Pimcore\Bundle\GoogleMarketingBundle\PimcoreGoogleMarketingBundle::class => ['all' => true],
    \Pimcore\Bundle\CustomReportsBundle\PimcoreCustomReportsBundle::class => ['all' => true],
    \Pimcore\Bundle\WordExportBundle\PimcoreWordExportBundle::class => ['all' => true],
    \Pimcore\Bundle\XliffBundle\PimcoreXliffBundle::class => ['all' => true],
    \Pimcore\Bundle\BundleGeneratorBundle\PimcoreBundleGeneratorBundle::class => ['dev' => true],
    \Pimcore\Bundle\FileExplorerBundle\PimcoreFileExplorerBundle::class => ['all' => true],
    \Pimcore\Bundle\SystemInfoBundle\PimcoreSystemInfoBundle::class => ['all' => true],
    \Pimcore\Bundle\WebToPrintBundle\PimcoreWebToPrintBundle::class => ['all' => true],
    \CoreShop\Bundle\CoreBundle\CoreShopCoreBundle::class => ['all' => true],
    \Blackbit\DataDirectorBundle\BlackbitDataDirectorBundle::class => ['all' => true],
    ToolboxBundle\ToolboxBundle::class => ['all' => true],
    SeoBundle\SeoBundle::class => ['all' => true],

Is this a bug or am I doing something wrong?

dpfaffenbauer commented 7 months ago

maybe related to: https://github.com/coreshop/CoreShop/issues/2583

dpfaffenbauer commented 7 months ago

@JustMe69 this might fix it: https://github.com/coreshop/CoreShop/pull/2606

can you maybe confirm?

JustMe69 commented 7 months ago

No, it does not help.

After installing some plugins which were only required by composer, pimcore didn't loaded any extension. I tried to mangae extensions.

It only helped after hours, uninstalling PimcoreGoogleMarketingBundle it is still in the bundles.php, but now all plugins are loaded and accessible in pimcore.

The reported error is still the same, also on 4.0.x-dev

When pimcore is started, the following error shows up in console:

Cannot create class with null properties! A possible case for this error is using the class pimcore.plugin.admin

Only CoreShopCustomer and/or CoreShopCompany class won't open in obect-editor.

The error in console:

Uncaught TypeError: Cannot read properties of undefined (reading 'prototype')
    at constructor.addDataChild (script-proxy?storageFile=minified_javascript_core_71a07e49c784288221dbca044e656158.js&_dc=71e2ff092ad5d052f67fc9b8afcdb79d95691ebb:51330:56)
    at klass.recursiveAddNode (script-proxy?storageFile=minified_javascript_core_71a07e49c784288221dbca044e656158.js&_dc=71e2ff092ad5d052f67fc9b8afcdb79d95691ebb:50288:19)
    at klass.recursiveAddNode (script-proxy?storageFile=minified_javascript_core_71a07e49c784288221dbca044e656158.js&_dc=71e2ff092ad5d052f67fc9b8afcdb79d95691ebb:50292:22)
    at klass.recursiveAddNode (script-proxy?storageFile=minified_javascript_core_71a07e49c784288221dbca044e656158.js&_dc=71e2ff092ad5d052f67fc9b8afcdb79d95691ebb:50292:22)
    at klass.initLayoutFields (script-proxy?storageFile=minified_javascript_core_71a07e49c784288221dbca044e656158.js&_dc=71e2ff092ad5d052f67fc9b8afcdb79d95691ebb:50268:62)
    at klass.initialize (script-proxy?storageFile=minified_javascript_core_71a07e49c784288221dbca044e656158.js&_dc=71e2ff092ad5d052f67fc9b8afcdb79d95691ebb:50103:14)
    at new klass (class.js?_dc=71e2ff092ad5d052f67fc9b8afcdb79d95691ebb:33:29)
    at klass.addClassPanel (script-proxy?storageFile=minified_javascript_core_71a07e49c784288221dbca044e656158.js&_dc=71e2ff092ad5d052f67fc9b8afcdb79d95691ebb:51810:26)
    at Object.callback (ext-all.js?_dc=71e2ff092ad5d052f67fc9b8afcdb79d95691ebb:1827:134)
    at constructor.onComplete (ext-all.js?_dc=71e2ff092ad5d052f67fc9b8afcdb79d95691ebb:2655:25)

in the request I can see the json response: I'm wondering if "parentClass": "CoreShop\\Component\\Customer\\Model\\Customer", is correct for CoreShopCompany class?

{
    "dao": null,
    "id": "cs_company",
    "name": "CoreShopCompany",
    "title": "",
    "description": "",
    "creationDate": null,
    "modificationDate": 1712842126,
    "userOwner": 0,
    "userModification": 2,
    "parentClass": "CoreShop\\Component\\Customer\\Model\\Customer",
    "implementsInterfaces": "",
    "listingParentClass": "",
    "useTraits": "",
    "listingUseTraits": "",
    "encryption": false,
    "encryptedTables": [],
    "allowInherit": false,
    "allowVariants": false,
    "showVariants": false,
    "layoutDefinitions": {
        "name": "pimcore_root",
        "type": null,
        "region": null,
        "title": null,
        "width": 0,
        "height": 0,
        "collapsible": false,
        "collapsed": false,
        "bodyStyle": null,
        "datatype": "layout",
        "children": [
            {
                "name": "Layout",
                "type": null,
                "region": null,
                "title": null,
                "width": 0,
                "height": 0,
                "collapsible": false,
                "collapsed": false,
                "bodyStyle": null,
                "datatype": "layout",
                "children": [
                    {
                        "name": "information",
                        "type": null,
                        "region": null,
                        "title": "coreshop.customer.information",
                        "width": 0,
                        "height": 0,
                        "collapsible": false,
                        "collapsed": false,
                        "bodyStyle": "",
                        "datatype": "layout",
                        "children": [
                            {
                                "name": "salutation",
                                "title": "coreshop.customer.salutation",
                                "tooltip": "",
                                "mandatory": false,
                                "noteditable": false,
                                "index": false,
                                "locked": false,
                                "style": "",
                                "permissions": null,
                                "fieldtype": "input",
                                "relationType": false,
                                "invisible": false,
                                "visibleGridView": false,
                                "visibleSearch": false,
                                "defaultValue": null,
                                "columnLength": 190,
                                "regex": "",
                                "regexFlags": [],
                                "unique": false,
                                "showCharCount": false,
                                "width": null,
                                "defaultValueGenerator": "",
                                "datatype": "data"
                            },
                            {
                                "name": "firstname",
                                "title": "coreshop.customer.firstname",
                                "tooltip": "",
                                "mandatory": false,
                                "noteditable": false,
                                "index": false,
                                "locked": false,
                                "style": "",
                                "permissions": null,
                                "fieldtype": "firstname",
                                "relationType": false,
                                "invisible": false,
                                "visibleGridView": true,
                                "visibleSearch": true,
                                "defaultValue": null,
                                "columnLength": 190,
                                "regex": "",
                                "regexFlags": [],
                                "unique": false,
                                "showCharCount": false,
                                "width": null,
                                "defaultValueGenerator": "",
                                "datatype": "data"
                            },
                            {
                                "name": "lastname",
                                "title": "coreshop.customer.lastname",
                                "tooltip": "",
                                "mandatory": false,
                                "noteditable": false,
                                "index": false,
                                "locked": false,
                                "style": "",
                                "permissions": null,
                                "fieldtype": "lastname",
                                "relationType": false,
                                "invisible": false,
                                "visibleGridView": true,
                                "visibleSearch": true,
                                "defaultValue": null,
                                "columnLength": 190,
                                "regex": "",
                                "regexFlags": [],
                                "unique": false,
                                "showCharCount": false,
                                "width": null,
                                "defaultValueGenerator": "",
                                "datatype": "data"
                            },
                            {
                                "name": "company",
                                "title": "coreshop.customer.company",
                                "tooltip": null,
                                "mandatory": false,
                                "noteditable": true,
                                "index": false,
                                "locked": false,
                                "style": "",
                                "permissions": null,
                                "fieldtype": "coreShopRelation",
                                "relationType": true,
                                "invisible": false,
                                "visibleGridView": false,
                                "visibleSearch": false,
                                "classes": [
                                    {
                                        "classes": "CoreShopCompany"
                                    }
                                ],
                                "displayMode": null,
                                "pathFormatterClass": "@DataDirectorSearchViewPathFormatter",
                                "assetInlineDownloadAllowed": false,
                                "allowToClearRelation": true,
                                "objectsAllowed": true,
                                "assetsAllowed": false,
                                "assetTypes": [],
                                "documentsAllowed": false,
                                "documentTypes": [],
                                "width": "",
                                "stack": "coreshop.company",
                                "returnConcrete": false,
                                "datatype": "data"
                            },
                            {
                                "name": "email",
                                "title": "coreshop.customer.email",
                                "tooltip": "",
                                "mandatory": false,
                                "noteditable": false,
                                "index": false,
                                "locked": false,
                                "style": "",
                                "permissions": null,
                                "fieldtype": "email",
                                "relationType": false,
                                "invisible": false,
                                "visibleGridView": true,
                                "visibleSearch": true,
                                "defaultValue": null,
                                "columnLength": 190,
                                "regex": "",
                                "regexFlags": [],
                                "unique": false,
                                "showCharCount": false,
                                "width": null,
                                "defaultValueGenerator": "",
                                "datatype": "data"
                            },
                            {
                                "name": "password",
                                "title": "coreshop.customer.password",
                                "tooltip": "",
                                "mandatory": false,
                                "noteditable": false,
                                "index": false,
                                "locked": false,
                                "style": "",
                                "permissions": null,
                                "fieldtype": "password",
                                "relationType": false,
                                "invisible": false,
                                "visibleGridView": false,
                                "visibleSearch": false,
                                "algorithm": "password_hash",
                                "salt": "",
                                "saltlocation": "back",
                                "minimumLength": null,
                                "width": "",
                                "datatype": "data"
                            },
                            {
                                "name": "newsletterActive",
                                "title": "coreshop.customer.newsletter_active",
                                "tooltip": "",
                                "mandatory": false,
                                "noteditable": false,
                                "index": false,
                                "locked": false,
                                "style": "",
                                "permissions": null,
                                "fieldtype": "newsletterActive",
                                "relationType": false,
                                "invisible": false,
                                "visibleGridView": false,
                                "visibleSearch": false,
                                "defaultValue": null,
                                "defaultValueGenerator": "",
                                "datatype": "data"
                            },
                            {
                                "name": "newsletterConfirmed",
                                "title": "coreshop.customer.newsletter_confirmed",
                                "tooltip": "",
                                "mandatory": false,
                                "noteditable": true,
                                "index": false,
                                "locked": false,
                                "style": "",
                                "permissions": null,
                                "fieldtype": "newsletterConfirmed",
                                "relationType": false,
                                "invisible": false,
                                "visibleGridView": true,
                                "visibleSearch": true,
                                "defaultValue": 0,
                                "defaultValueGenerator": "",
                                "datatype": "data"
                            },
                            {
                                "name": "isGuest",
                                "title": "coreshop.customer.is_guest",
                                "tooltip": "",
                                "mandatory": false,
                                "noteditable": false,
                                "index": false,
                                "locked": false,
                                "style": "",
                                "permissions": null,
                                "fieldtype": "checkbox",
                                "relationType": false,
                                "invisible": false,
                                "visibleGridView": true,
                                "visibleSearch": true,
                                "defaultValue": 0,
                                "defaultValueGenerator": "",
                                "datatype": "data"
                            },
                            {
                                "name": "gender",
                                "title": "coreshop.customer.gender",
                                "tooltip": "",
                                "mandatory": false,
                                "noteditable": false,
                                "index": false,
                                "locked": false,
                                "style": "",
                                "permissions": null,
                                "fieldtype": "gender",
                                "relationType": false,
                                "invisible": false,
                                "visibleGridView": true,
                                "visibleSearch": true,
                                "options": [
                                    {
                                        "key": "male",
                                        "value": "male"
                                    },
                                    {
                                        "key": "female",
                                        "value": "female"
                                    },
                                    {
                                        "key": "other",
                                        "value": "other"
                                    },
                                    {
                                        "key": "unknown",
                                        "value": "unknown"
                                    }
                                ],
                                "defaultValue": null,
                                "columnLength": 190,
                                "dynamicOptions": false,
                                "defaultValueGenerator": "",
                                "width": "",
                                "optionsProviderType": null,
                                "optionsProviderClass": null,
                                "optionsProviderData": null,
                                "datatype": "data"
                            },
                            {
                                "name": "passwordResetHash",
                                "title": "coreshop.customer.reset_password_hash",
                                "tooltip": "",
                                "mandatory": false,
                                "noteditable": true,
                                "index": false,
                                "locked": false,
                                "style": "",
                                "permissions": null,
                                "fieldtype": "input",
                                "relationType": false,
                                "invisible": true,
                                "visibleGridView": false,
                                "visibleSearch": false,
                                "defaultValue": null,
                                "columnLength": 190,
                                "regex": "",
                                "regexFlags": [],
                                "unique": false,
                                "showCharCount": false,
                                "width": null,
                                "defaultValueGenerator": "",
                                "datatype": "data"
                            },
                            {
                                "name": "localeCode",
                                "title": "coreshop.customer.locale",
                                "tooltip": "",
                                "mandatory": false,
                                "noteditable": true,
                                "index": false,
                                "locked": false,
                                "style": "",
                                "permissions": null,
                                "fieldtype": "input",
                                "relationType": false,
                                "invisible": false,
                                "visibleGridView": false,
                                "visibleSearch": false,
                                "defaultValue": null,
                                "columnLength": 190,
                                "regex": "",
                                "regexFlags": [],
                                "unique": false,
                                "showCharCount": false,
                                "width": null,
                                "defaultValueGenerator": "",
                                "datatype": "data"
                            }
                        ],
                        "locked": false,
                        "fieldtype": "fieldset",
                        "labelWidth": 100,
                        "labelAlign": "left"
                    },
                    {
                        "name": "groups",
                        "type": null,
                        "region": null,
                        "title": "Groups",
                        "width": 0,
                        "height": 0,
                        "collapsible": false,
                        "collapsed": false,
                        "bodyStyle": "",
                        "datatype": "layout",
                        "children": [
                            {
                                "name": "customerGroups",
                                "title": "coreshop.customer.groups",
                                "tooltip": null,
                                "mandatory": false,
                                "noteditable": false,
                                "index": false,
                                "locked": false,
                                "style": "",
                                "permissions": null,
                                "fieldtype": "coreShopRelations",
                                "relationType": true,
                                "invisible": false,
                                "visibleGridView": false,
                                "visibleSearch": false,
                                "classes": [
                                    {
                                        "classes": "CoreShopCustomerGroup"
                                    }
                                ],
                                "displayMode": null,
                                "pathFormatterClass": "@DataDirectorSearchViewPathFormatter",
                                "maxItems": null,
                                "assetInlineDownloadAllowed": false,
                                "allowToClearRelation": true,
                                "objectsAllowed": true,
                                "assetsAllowed": false,
                                "assetTypes": [],
                                "documentsAllowed": false,
                                "documentTypes": [],
                                "enableTextSelection": false,
                                "width": "",
                                "height": 400,
                                "stack": "coreshop.customer_group",
                                "datatype": "data"
                            }
                        ],
                        "locked": false,
                        "fieldtype": "panel",
                        "layout": null,
                        "border": false,
                        "icon": null,
                        "labelWidth": 100,
                        "labelAlign": "left"
                    }
                ],
                "locked": false,
                "fieldtype": "tabpanel",
                "border": false,
                "tabPosition": "top"
            }
        ],
        "locked": false,
        "fieldtype": "panel",
        "layout": null,
        "border": false,
        "icon": null,
        "labelWidth": 100,
        "labelAlign": "left"
    },
    "icon": "\/bundles\/coreshopcustomer\/pimcore\/img\/company.svg",
    "group": "CoreShop",
    "showAppLoggerTab": false,
    "linkGeneratorReference": "",
    "previewGeneratorReference": "@DataDirectorPreview",
    "compositeIndices": [],
    "showFieldLookup": false,
    "propertyVisibility": {
        "grid": {
            "id": true,
            "path": true,
            "published": true,
            "modificationDate": true,
            "creationDate": true
        },
        "search": {
            "id": true,
            "path": true,
            "published": true,
            "modificationDate": true,
            "creationDate": true
        }
    },
    "enableGridLocking": false,
    "blockedVarsForExport": [],
    "fieldDefinitionsCache": [],
    "isWriteable": true
}

afaik is this the CoreShopCustomer class definition

when I look into the var/classes/definition_CoreShopCompany.php file, its a copy of CoreShopCustomer? with name CoreShopCompany

@dpfaffenbauer Can you send me a correct var/classes/definition_CoreShopCompany.php file? or attach it here?

JustMe69 commented 7 months ago

next curiosity

when trying to execute:

bin/console pimcore:definition:import:class -n vendor/coreshop/core-shop/src/CoreShop/Bundle/CustomerBundle/Resources/install/pimcore/classes/CoreShopCompany.json

I'm getting error:

In AbstractStructureImportCommand.php line 66:

  File name does not match expected format

Am I doing something wrong?

JustMe69 commented 7 months ago

Tried workaround:

downloaded class-definitions for CoreShopCustomer and CoreShopCompany from CoreShop 4 - Demo-Shop - exported from backend deleted existing classes (Company, Customer) in backend imported class definitions

Result:

CoreShopCompany now shows up, with correct fields

CoreShopCustomer is still the same error:

Uncaught TypeError: Cannot read properties of undefined (reading 'prototype')
    at constructor.addDataChild (script-proxy?storageFile=minified_javascript_core_71a07e49c784288221dbca044e656158.js&_dc=71e2ff092ad5d052f67fc9b8afcdb79d95691ebb:51330:56)
    at klass.recursiveAddNode (script-proxy?storageFile=minified_javascript_core_71a07e49c784288221dbca044e656158.js&_dc=71e2ff092ad5d052f67fc9b8afcdb79d95691ebb:50288:19)
    at klass.recursiveAddNode (script-proxy?storageFile=minified_javascript_core_71a07e49c784288221dbca044e656158.js&_dc=71e2ff092ad5d052f67fc9b8afcdb79d95691ebb:50292:22)
    at klass.recursiveAddNode (script-proxy?storageFile=minified_javascript_core_71a07e49c784288221dbca044e656158.js&_dc=71e2ff092ad5d052f67fc9b8afcdb79d95691ebb:50292:22)
    at klass.initLayoutFields (script-proxy?storageFile=minified_javascript_core_71a07e49c784288221dbca044e656158.js&_dc=71e2ff092ad5d052f67fc9b8afcdb79d95691ebb:50268:62)
    at klass.initialize (script-proxy?storageFile=minified_javascript_core_71a07e49c784288221dbca044e656158.js&_dc=71e2ff092ad5d052f67fc9b8afcdb79d95691ebb:50103:14)
    at new klass (class.js?_dc=71e2ff092ad5d052f67fc9b8afcdb79d95691ebb:33:29)
    at klass.addClassPanel (script-proxy?storageFile=minified_javascript_core_71a07e49c784288221dbca044e656158.js&_dc=71e2ff092ad5d052f67fc9b8afcdb79d95691ebb:51810:26)
    at Object.callback (ext-all.js?_dc=71e2ff092ad5d052f67fc9b8afcdb79d95691ebb:1827:134)
    at constructor.onComplete (ext-all.js?_dc=71e2ff092ad5d052f67fc9b8afcdb79d95691ebb:2655:25)
dpfaffenbauer commented 7 months ago

@JustMe69 definitely related to https://github.com/coreshop/CoreShop/issues/2583, I'll close this one.

dpfaffenbauer commented 7 months ago

@JustMe69 can you test the latest 4.0.x-dev?