Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi!
i need to embed entity add form in my module.
full path to default entity add form look like: http://*****/admin/structure/entity-type/gallery/gallery/add?destination
i have tried entity_ui_get_form('gallery', null, 'add');
but it throws me a lot of errors.
any advice? thank you.
Comments
Comment #1
muka CreditAttribution: muka commentedI used this:
Comment #2
tomas.teicher CreditAttribution: tomas.teicher commentedmuka's solution #1 works for me too.
Comment #3
谢艳 CreditAttribution: 谢艳 commentedhi, there is a problem,
how to set argument at eck add form?
er..... like drupal_get_form(),can set argument
Comment #4
qqboy CreditAttribution: qqboy commented@muka
i used as you said, then we see the form, but click save but can not save data.
do you have the issue, or codes on your site work well and normally.
thanks.
Comment #5
caschbre CreditAttribution: caschbre commentedI'm having the same issue as qqboy. I added the two lines as in #1. The form renders but when I click save the entity is saved without any values. And the validation handler doesn't seem to run as required fields make it through blank/empty.
Comment #6
dimaboychev CreditAttribution: dimaboychev commentedThis will work. but if your page callback is drupal_get_form you will have to take care of saving values yourself.