Hi,

I am trying to add an edit form using Entity_type/entity_bundle. Everything seems to be working when i enable "entity_type add/edit form", I can modify and apply anything on the page.

However when I try to apply this to a new custom page, the variant behaviour changes and adding a new field form, only displays "Entity info." string instead of a beautiful form field...

Do you know what could be the reason of this ?

Usually when I use a node, I just need to add in contexts > RELATIONSHIPS > "Node edit form from node", which is quite easy.

Maybe having the same could be great ? (and fast to add on the custom page too)

Thanks

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cifren created an issue. See original summary.

cifren’s picture

I created the part myself, I will be sharing it soon.

mnico’s picture

Thank you ;).
The context "ECK edit form" does not exist. If you created the context would be a very good contribution :)

Regards

mnico’s picture

Version: 7.x-1.0-beta4 » 7.x-1.x-dev
cifren’s picture

https://cifrenblog.wordpress.com/2016/09/16/create-your-own-edit-form-on...

Here is the tutorial how to create it, it is working on my website as a custom module.

On the tutorial it is missing the relationship part, but it is already available on the Github sources.

I will create the post next week to explain how I did it the relationship part.

Everything is on the post.

Let me know if you have difficulties to implement it.

mnico’s picture

Wow that's cool! I recommend that you create and upload a patch here, making your contribution relates to your profile drupal.org.
Here we can make some changes later if necessary.

Regards

cifren’s picture

Can you explain how to do it ? I'll do it on Friday (Blog day !)

mnico’s picture

Exists a post about that https://www.drupal.org/node/707484

When you have the patch, you must upload it in a new comment in the "Files" field.

Good luck ;)

cifren’s picture

Here the patch, I tested it on clean drupal 7 with eck_pm and suite. It was working.

mnico’s picture

@cifren for some reason the file is empty.
Make sure to create a new branch from 7.x-1.x, then apply your changes and commit it in your new branch and run git diff 7.x-1.x > my_patch.patch

regards

mnico’s picture

Status: Active » Needs work
cifren’s picture

My bad...

This new one, should be better.

cifren’s picture

Sorry again, i didn't commit before sending it so, the previous diff file was missing lines.

cifren’s picture

Have you been able to implement it ?

mnico’s picture

Sorry @cifren. I have not had enough time to review it. I will try to test it this weekend.

Regards

  • mnico committed 6cc8089 on 7.x-1.x authored by cifren
    Issue #2799943 by cifren, mnico: Edit form on page manager, custom page
    
mnico’s picture

Hello, I reviewed the patch. I have made some changes:
1. I committed only the context "edit form" (nice work). About relationships, i don't understand how this works.
2. I fixed some code style (about this see https://www.drupal.org/docs/develop/standards/coding-standards).
3. I created the argument plugin for "edit form". You can create a panel page using a path like this: "my-path-entity/%entity-edit-form" and the argument %entity-edit-form can be the context "edit form". I don't know if this is what the relationship plugin try to do. You have a post about this so i will try to read it to understand the relationship plugin.

Regards

mnico’s picture

Status: Needs work » Needs review

Can you try the latest commit and tell me if it is enough or if I would add the other components?

spasem’s picture

This was exactly what I needed for one of my sites.

However, I just tested this feature and works fine with the form being enabled but I am having an issue with supplying url arguments to the form. I am using the entityreference prepopulate module to populate ECK fields but the form is not prepopulating when using a custom page. Prepopulating works fine when the standard ECK edit or add form is enabled in page manager but when I create my own custom page with the edit_form context, prepopulating does not work. Am I missing something?

Thanks

apaderno’s picture

Issue tags: -form