BoltTranslate / Translate

Provides translation for contenttypes.
Other
43 stars 38 forks source link

[BUG] Translatable slug bad beahaviur #147

Closed jimi75 closed 6 years ago

jimi75 commented 6 years ago

Details

When slug contenttype is set to is_translatable: true after change the slug for a none default language and save i get this error.

Uncaught Exception: ContextErrorException .

ContextErrorException in Legacy.php line 121: 
Warning: Invalid argument supplied for foreach()

                        $originalMapping[$key]['fields'] = $contentType['fields'][$key]['fields'];
                        $originalMapping[$key]['type'] = 'repeater';
                        $mapping = $app['storage.metadata']->getRepeaterMapping($originalMapping);
                        $record[$key] = new RepeatingFieldCollection($app['storage'], $mapping);

                        foreach ($value as $subValue) {
                            $record[$key]->addFromArray($subValue);
                        }
                    }
                }
            }
jimi75 commented 6 years ago

I realized what the problem is. Hydration of empty repeater fields cause the error. I already have the solution in this PR #148

Thanks guys for the incredible work. BOLT ROCKS!