Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown preview doesn't work on pivot #6643

Open
niekdemelker opened this issue Dec 28, 2024 · 2 comments
Open

Markdown preview doesn't work on pivot #6643

niekdemelker opened this issue Dec 28, 2024 · 2 comments
Labels
bug Verified bug by the Nova team fix incoming A fix is in review
Milestone

Comments

@niekdemelker
Copy link

Description:

I have a pivot table with a text area, so users can add notes to a relation in markdown, but the markdown preview doesn't work when i attach a attachment in Nova.
afbeelding

When I create an extra markdown field on the ralated resource the preview will work again. Problem is i also have to do this on the other side of the relation, defining the markdown field 3 times.

The url rendering the error looks as follow, you can see the preview is requesting to the Tenants.php and not to the SystemFields.php so it cannot render the preview.

/nova-api/tenants/field/comment/preview?editing=true&editMode=update

// Tenants.php resource field definition

BelongsToMany::make('Systems')
    ->fields(new SystemFields)

// Workaround to get the pivot table field working
Markdown::make('Notes')
    ->onlyOnIndex()
    ->hideFromIndex(),
// SystemFields.php

public function __invoke()
{
    return [
        Markdown::make('Notes')
            ->alwaysShow(),
    ];
}

Detailed steps to reproduce the issue on a fresh Nova installation:

Create a pivot table with text area, and define a markdown field in the BelongToMany fields.

@crynobone
Copy link
Member

Reproduce step is not clear, please provide a full reproducing repository based on fresh installation as suggested in the bug report template (or you can refer to https://github.com/nova-issues for example)

@crynobone crynobone added the needs more info More information is required label Dec 29, 2024
@niekdemelker
Copy link
Author

@crynobone sure thing: https://github.com/niekdemelker/issue-6643

  1. publish assets and create a nova user
  2. login
  3. in the menu select 'Systems' and create a system
  4. from this system, attach a user
  5. in the form to select an user there is a markdown, the preview doesn't work <- the bug

@crynobone crynobone added bug Verified bug by the Nova team and removed needs more info More information is required labels Dec 30, 2024
@crynobone crynobone added this to the 5.1.x milestone Dec 30, 2024
@crynobone crynobone added the fix incoming A fix is in review label Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified bug by the Nova team fix incoming A fix is in review
Projects
None yet
Development

No branches or pull requests

2 participants