Skip to content

Creating a new post will overwrite an existing post when the file already exists #489

@alzeih

Description

@alzeih

Description:

Creating a new post will overwrite an existing post sometimes.

This happens when the filename where the post is to be saved is the same as an existing filename.

Tell us a bit about yourself:

  • Version of JekyllAdmin I'm using <HINT: use bundle show to check>: jekyll-admin (0.8.1)
  • Version of Jekyll I'm using <HINT: use bundle show to check>: jekyll (3.8.5)
  • Version of NodeJS I'm using <HINT: use node -v to check>: none
  • Operating System <e.g. OS X, Windows>: linux
  • Browser <e.g, Safari, Chrome>: Chrome

Steps to reproduce:

  1. Create a new (first) post with the title as "test" and no path.
  2. Add some content to the first post.
  3. Create the first post.
  4. Then, create another new (second) post also with the title "test" and no path. This should be done close enough in time to the first one, i.e: the same day usually.
  5. Add some different content to the second post.
  6. Create the second post.

I expected the following:

The second post should not not overwrite the first post.

But got the following, instead:

The first post will be replaced by the second post, and the first post is lost.

Other details:

This isn't quite so bad with posts as the filename usually contains a date, so it's less likely to accidentally happen.

With collections though which the title can be the only element that ends up in the filename, it's easier to overwrite an existing item in a collection. (repeat steps above with a collection other than posts that doesn't have a date in the file name / path.)

Overwriting the file makes sense for editing existing posts, but I don't think it makes sense when creating new posts. (Same for collections.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions