React-admin: editbutton on referencemanyfield link to the parent resouce

Created on 3 Jul 2018  路  10Comments  路  Source: marmelab/react-admin

Other information: editbutton on referencemanyfield link to the parent resouce

Environment

  • React-admin version: > 2.0.3
  • Last version that did not exhibit the issue (if applicable):
  • React version:
  • Browser:
  • Stack trace (in case of a JS error):
bug

Most helpful comment

Official ETA is the 13/07. However, as this is a critical issue, I'll see if we can release it sooner. Ping @fzaninotto

All 10 comments

I can't reproduce this issue. If you are able to illustrate the bug or feature request with an example, please provide a sample application via one of the following means:

  • CodeSandbox (https://codesandbox.io/s/p3nq3lyjzq)
  • A sample application via GitHub

I also have the same problem.

export const CommentEdit = props => (
    <Edit {...props}>
        <SimpleForm>
            <DisabledInput source="id" />
            <ReferenceField
                source="post_id"
                reference="posts"
                perPage={15}
                sort={{ field: 'title', order: 'ASC' }}
            >
                <TextField source="title" />
            </ReferenceField>
            <TextInput source="author.name" validate={minLength(10)} />
            <DateInput source="created_at" />
            <LongTextInput source="body" validate={minLength(10)} />
        </SimpleForm>
    </Edit>
);

When <ReferenceField> is used inside <Edit>, the link is BASE_URL/#/comments/1 inplace of BASE_URL/#/posts/1. In cas of <Show> it is working as expected.

I can reproduce @ashim-k-saha's bug but not @data-server's one.

@data-server Please provide a codesandbox which reproduces the issue

Official ETA is the 13/07. However, as this is a critical issue, I'll see if we can release it sooner. Ping @fzaninotto

@fzaninotto I can still experience the issue using 2.1.1.

Using a <ReferenceArrayField> inside <Edit>.

looks like it overrides the ReferenceArrayField's ID object field and uses the parent's ID by default.

Would you mind setting up a codesandbox with a reproduction ?

bump

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MhdSyrwan picture MhdSyrwan  路  24Comments

christiaanwesterbeek picture christiaanwesterbeek  路  19Comments

keulu-ing picture keulu-ing  路  22Comments

ragboyjr picture ragboyjr  路  29Comments

olegweb picture olegweb  路  23Comments