Skip to content

Editing entry in list will write changes back to first entry #3484

@four-bytes-robby

Description

@four-bytes-robby

Code of Conduct

Submission validity

  • This is not a personal support request, that should be posted on discussions community.
  • I checked current issues and this request isn't a duplicate of an existing issue, opened or closed.

Self troubleshooting

Version

1.9.1

Description

When editing not the first url in list (e.g. second) and saving it, the changed entry will be placed on top of the list.

When refreshing the page it shows that it is saved correctly.

Javascript bug when saving.

Expectation

When saved the correct line is being updated.

Reproduction steps

  1. Go to Admin
  2. Have at least two entries
  3. Edit second entry inline and hit save
  4. Will be placed in the first line

Context

Investigation:

  • yourls_table_edit_row is handling the keyword only
  • it calls yourls_unique_element_id without any id parameter thus always returning the id for the first row
  • html of the ajax request for getting edit html will always returning the edit row with the first result

Suggested solution:

  • call yourls_table_edit_row with optional parameter (id / row id)
  • in yourls_table_edit_row call yourls_unique_element_id with parameter

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions