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.

Spoiler

Fields:
Title, as a PageTitleLanguage field
headline, as a TextLanguage field
embed_code, as a  Textarea field.

Templates have same access, family policy etc. etc.


Setup:
ProcessWire  3.0.229
Textarea (Multi-language)  1.0.0
Text (Multi-language)  1.0.0
Page Title (Multi-language)  1.0.0
Languages Support  1.0.3
Languages Support - Fields  1.0.1
Languages Support - Tabs  1.1.7
Languages Support - Page Names  0.1.3
Pages Export/Import  0.0.1

Same Languages setup on both sites: default as italian language, en as english and de for german (this is hidden, actually we're only using "it" and "en" into these sites).

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".

Spoiler

Yow… Fatal Error: Uncaught Error: Call to a member function setLanguageValue() on null in wire/modules/LanguageSupport/FieldtypeTextLanguage.module:160

#0 [internal function]: FieldtypeTextLanguage->___importValue()
#1 wire/core/Wire.php (425): call_user_func_array()
#2 wire/core/WireHooks.php (968): Wire->_callMethod()
#3 wire/core/Wire.php (484): WireHooks->runHooks()
#4 wire/core/PagesExportImport.php (957): Wire->__call()
#5 wire/core/PagesExportImport.php (643): PagesExportImport->importFieldValue()
#6 wire/modules/Process/ProcessPagesExportImport/ProcessPagesExportImport.module (639): PagesExportImport->arrayToPage()
#7 wire/modules/Process/ProcessPagesExportImport/ProcessPagesExportImport.module (328): ProcessPagesExportImport->processImportItemToPage()
#8 wire/modules/Process/ProcessPagesExportImport/ProcessPagesExportImport.module (251): ProcessPagesExportImport->processImportSubmit()
#9 wire/modules/Process/ProcessPagesExportImport/ProcessPagesExportImport.module (76): ProcessPagesExportImport->processImport()
#10 wire/core/Wire.php (413): ProcessPagesExportImport->___execute()
#11 wire/core/WireHooks.php (968): Wire->_callMethod()
#12 wire/core/Wire.php (484): WireHooks->runHooks()
#13 wire/core/ProcessController.php (361): Wire->__call()
#14 wire/core/Wire.php (413): ProcessController->___execute()
#15 wire/core/WireHooks.php (968): Wire->_callMethod()
#16 wire/core/Wire.php (484): WireHooks->runHooks()
#17 wire/core/admin.php (160): Wire->__call()
#18 wire/modules/AdminTheme/AdminThemeUikit/controller.php (15): require('...')
#19 site/templates/admin.php (43): require('...')
#20 wire/core/TemplateFile.php (328): require('...')
#21 wire/core/Wire.php (413): TemplateFile->___render()
#22 wire/core/WireHooks.php (968): Wire->_callMethod()
#23 wire/core/Wire.php (484): WireHooks->runHooks()
#24 wire/modules/PageRender.module (574): Wire->__call()
#25 wire/core/Wire.php (416): PageRender->___renderPage()
#26 wire/core/WireHooks.php (968): Wire->_callMethod()
#27 wire/core/Wire.php (484): WireHooks->runHooks()
#28 wire/core/WireHooks.php (1094): Wire->__call()
#29 wire/core/Wire.php (484): WireHooks->runHooks()
#30 wire/modules/Process/ProcessPageView.module (184): Wire->__call()
#31 wire/modules/Process/ProcessPageView.module (114): ProcessPageView->renderPage()
#32 wire/core/Wire.php (416): ProcessPageView->___execute()
#33 wire/core/WireHooks.php (968): Wire->_callMethod()
#34 wire/core/Wire.php (484): WireHooks->runHooks()
#35 index.php (55): Wire->__call()
#36 {main}
thrown (line 160 of wire/modules/LanguageSupport/FieldtypeTextLanguage.module)

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...