Jump to content

Core Module Export/Import – Error


ngrmm
 Share

Recommended Posts

I tried to import pages from another pw-installation
The process results in an error as soon as it starts doing the import. All steps before ok (choosing destination, linking fields, …) working fine.
PW creates one page, sets the page name but is not able to set the page title and gives this error:

Schwerwiegender Fehler: Uncaught Error: Call to a member function setLanguageValue() on null in wire/modules/LanguageSupport/FieldtypeTextLanguage.module:159

#0 wire/modules/LanguageSupport/FieldtypeTextareaLanguage.module (114): FieldtypeTextLanguage->___importValue(Object(Page), Object(Field), Array, Array)
#1 [internal function]: FieldtypeTextareaLanguage->___importValue(Object(Page), Object(Field), Array, Array)
#2 wire/core/Wire.php (425): call_user_func_array(Array, Array)
#3 wire/core/WireHooks.php (952): Wire->_callMethod('___importValue', Array)
#4 wire/core/Wire.php (484): WireHooks->runHooks(Object(FieldtypeTextareaLanguage), 'importValue', Array)
#5 wire/core/PagesExportImport.php (957): Wire->__call('importValue', Arr (Zeile 159 in wire/modules/LanguageSupport/FieldtypeTextLanguage.module)

Diese Fehlermeldung wurde angezeigt wegen: Sie sind als Superuser angemeldet. Fehler wurde protokolliert.

Both sites have the same languages installed (default/de)

This is an example of my json:

{
    "type": "ProcessWire:PageArray",
    "created": "2023-05-18 11:32:25",
    "version": "3.0.200",
    "user": "admin",
    "host": "website.com",
    "pages": [
        {
            "type": "ProcessWire:Page",
            "path": "/path/path/some-title/",
            "class": "ProcessWire\\Page",
            "template": "team_member",
            "settings": {
                "id": 13702,
                "name": "some-title",
                "status": 1,
                "sort": 31,
                "sortfield": "sort",
                "created": "28-03-2022 18:39:22",
                "modified": "28-03-2022 18:46:39",
                "name_en": null,
                "status_en": 1
            },
            "data": {
                "title": {
                    "default": "Name LÖL",
                    "en": "Name LÖL"
                },
                "headline": {
                    "default": "",
                    "en": ""
                },
                "phone": "0987654321",
                "email": "email@website.com",
                "body": {
                    "default": "<p>text</p>",
                    "en": ""
                }
            }
        },
        …

 

Link to comment
Share on other sites

  • 10 months later...

Hi everybody. 
I pull up this post for the same problem exporting/importing pages with Export/Import.

I have the same template with same fields into two site ( let's call them "A" and "B") and same installation.

  Reveal hidden contents

Well, from site A to site B I can correctly export and import the pages.

But the odd behaviour is that from site B to site A, after the import test performed correctly, the  "Fatal Error: Uncaught Error: Call to a member function setLanguageValue() on null in wire/modules/LanguageSupport/FieldtypeTextLanguage.module:160 " occours on the import "commit".

  Reveal hidden contents

It seems that the PageTitleLanguage can't save the value: I find the created pages only with the name (url), but not the title (mandatory field)...

Anybody has an idea?

Many thanks in advance.

 

P.S.
line 160 in FieldtypeTextLanguage.module is in a foreach into the public function ___importValue(...) :

$importValue->setLanguageValue($language->id, $languageValue);

If it's important, but I dont't belive, into both sites the languages id are exactly the same (default = 1010, en = 1021). Also the fields have the same name.
I can't explain why is "null" the $importValue, that is derived from line 156: 

$importValue = $page->get($field->name);
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...