0

I've on the way to create my first native J4 Component by using Astrid's Tutorial (Link) - I've already figured out that some of the code parts are not fully J4 conform, but i was able to "update" my code where it was needed (JForm usage for example).

But on the step with the Multilingual Associations: Edit Associations i'm stuck. All is working so far an item can be associated when doing so from inside the component but when trying to use Components >> Multilingual Associations and go into the edit view of an item the page keeps reloading till the browser crashes.

I've already tried 3 times to undo my changes added in this chapter and do it again without success. It might be just a silly mistake from my side somewhere in the codebase but what i've seen so far is that Astrid's Code examples are truly 1-1 based on the J3 solution and might not work in current J4.2 anymore?

Can someone check my Repo and give me a hint what might be the problem of this "reloading" inside the Multilingual Associations Component. Branch (associations_implemented) Ready to install can be found here: https://github.com/marcorensch/company_partners/tree/associations_implemented

1 Answer 1

1

This is probably because your form view does not render the ID field. Associations script expects an input element with jform_id ID and the ID of the content item as the value. Since you're using hardcoded field names, adding this to the layout should work for you:

<?php echo $this->getForm()->renderField('id'); ?>

You can change field type in the form definition to hidden if you don't want it to be visible to users.

1
  • OMG that was quite simple - Thanks Sharky!
    – Marco
    Oct 22, 2022 at 10:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.