Issue Bug Closed

#101415Cannot localize page in backend

Oliver Hader 07/22/23, 17:59 updated 11/11/26, 12:30

Description

(Actions performed as admin user)

Error message in JavaScript console:

Uncaught TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at InputTransformer.flattenObject (input-transformer.js?bust=f9d9bd3aaf0d3feb0db376ef46b9f751eb2d2929:13:641)
    at input-transformer.js?bust=f9d9bd3aaf0d3feb0db376ef46b9f751eb2d2929:13:770
    at Array.reduce (<anonymous>)
    at InputTransformer.flattenObject (input-transformer.js?bust=f9d9bd3aaf0d3feb0db376ef46b9f751eb2d2929:13:649)
    at InputTransformer.toSearchParams (input-transformer.js?bust=f9d9bd3aaf0d3feb0db376ef46b9f751eb2d2929:13:481)
    at AjaxRequest.withQueryArguments (ajax-request.js?bust=f9d9bd3aaf0d3feb0db376ef46b9f751eb2d2929:13:352)
    at Localization.localizeRecords (localization.js?bust=f9d9bd3aaf0d3feb0db376ef46b9f751eb2d2929:13:6623)
    at Object.callback (localization.js?bust=f9d9bd3aaf0d3feb0db376ef46b9f751eb2d2929:13:5597)
    at Wizard.runSlideCallback (wizard.js?bust=f9d9bd3aaf0d3feb0db376ef46b9f751eb2d2929:13:3552)
flattenObject @ input-transformer.js?bust=f9d9bd3aaf0d3feb0db376ef46b9f751eb2d2929:13
(anonymous) @ input-transformer.js?bust=f9d9bd3aaf0d3feb0db376ef46b9f751eb2d2929:13
flattenObject @ input-transformer.js?bust=f9d9bd3aaf0d3feb0db376ef46b9f751eb2d2929:13
toSearchParams @ input-transformer.js?bust=f9d9bd3aaf0d3feb0db376ef46b9f751eb2d2929:13
withQueryArguments @ ajax-request.js?bust=f9d9bd3aaf0d3feb0db376ef46b9f751eb2d2929:13
localizeRecords @ localization.js?bust=f9d9bd3aaf0d3feb0db376ef46b9f751eb2d2929:13
(anonymous) @ localization.js?bust=f9d9bd3aaf0d3feb0db376ef46b9f751eb2d2929:13
runSlideCallback @ wizard.js?bust=f9d9bd3aaf0d3feb0db376ef46b9f751eb2d2929:13

The reason is, that in localization.ts, the corresponding action is still null, since there are two availableLocalizationModes@ (copy and translate), but the handling just expects to have one…

<a href="#" class="btn btn-default btn-sm t3js-localize" title=""
  data-page="[Translate to Dansk:] 404" data-has-elements="0"
  data-allow-copy="1" data-allow-translate="1" data-table="tt_content"
  data-page-id="6" data-language-id="1" data-language-name="Dansk">
...    
  Translate
</a>

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

Files 3

History 16

  1. Oliver Hader changed attached Screenshot 2023-07-22 at 19.46.25.png <span data-processor="relativetime" data-value="2023-07-22T18:00:38+00:00" > 07/22/23, 18:00 </span>

  2. Oliver Hader commented and changed attached 101415.png <span data-processor="relativetime" data-value="2023-07-22T18:20:22+00:00" > 07/22/23, 18:20 </span>

    Okay, the missing action actually seems to be related to not having a default selected (“translate” or “copy”) in the localization wizard (I think that was different in the past). Thus, by just clicking “next”, the action stays empty and this will cause the mentioned error…

    101415.png

  3. Francois Suter commented <span data-processor="relativetime" data-value="2023-10-24T07:06:43+00:00" > 10/24/23, 07:06 </span>

    I’m not sure if it’s correct to mention it here, but I have a similar error in another circumstance: when I try to create, for example, a menu of pages content element. While the content element is new, the suggest wizard does not work. The same error in “flattenObject” happens. As soon as the content element is saved at least once, the error goes away.

    Should I report it as a separate issue?

  4. Francois Suter commented <span data-processor="relativetime" data-value="2023-10-25T14:08:24+00:00" > 10/25/23, 14:08 </span>

    I dug into the issue I had and it is definitely different. I have opened a separate issue (https://forge.typo3.org/issues/102256).

  5. Tim Bäcker commented and changed attached Bildschirmaufnahme 2025-05-15 um 09.31.37.mov <span data-processor="relativetime" data-value="2025-05-15T07:57:14+00:00" > 05/15/25, 07:57 </span>

    Wouldn’t it be possible to set the first of the translation methods as default? Internally those are radio buttons I think.
    The problem could either be fixed by setting one radio button as selected by default or disallow continuing in the wizard as long as no method is selected.

    Right now – if you continue in the wizard the relevant part of the route that is called looks like this:

    /localize?srcLanguageId=0&destLanguageId=1&action=null

    action=null is obviously causing problems

    (I created a short video that shows the problem)

  6. Tim Bäcker commented <span data-processor="relativetime" data-value="2025-05-28T08:05:55+00:00" > 05/28/25, 08:05 </span>

    This is probably related or duplicates #105702

    1. unfortunately says this will probably not be fixed for v12
  7. Georg Ringer commented and changed status Accepted Closed <span data-processor="relativetime" data-value="2026-11-11T12:30:36+00:00" > 11/11/26, 12:30 </span>

    fixed for main, 12 won’t get any changes, therefore closing the issue