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

URL Bundles not generating for pre-existing collections. #64

Closed
ericta-portfolio opened this issue Jan 25, 2022 · 7 comments
Closed

URL Bundles not generating for pre-existing collections. #64

ericta-portfolio opened this issue Jan 25, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@ericta-portfolio
Copy link

Bug report

URL Bundles not generating for pre-existing collections.

On adding a URL bundle for a pre-existing collection that existed before plugin installation, links are not generated. Links are only generated for new entries made after installation. Duplicating pre-existing content does not generate a link either.

Steps to reproduce the behavior

  1. Create Strapi instance
  2. Create content collections (possibly without a UID field since I didn't have one before making URL bundles)
  3. Populate and publish the content collection
  4. Install sitemap plugin
  5. Create url bundle for the content collection
  6. Save and generate sitemap
  7. See error

Expected behavior

URL's created for the content collection.

System

  • Node.js version: 14.18.2
  • NPM version: 8.3.0
  • Strapi version: 4.0.4
  • Plugin version: 2.0.4

Additional context

Some of the other collections weren't generating either.
For one, I could get them generated by editing and saving content.
For another, I had to duplicate the content and delete the old one.
Neither of these worked for the ones created before adding the plugin.

@boazpoolman boazpoolman added the bug Something isn't working label Jan 25, 2022
@boazpoolman
Copy link
Member

Hey @ericta-portfolio

Thank you for the issue submission!

I've fixed this in PR #65.
Could you test it out in your project?

yarn add boazpoolman/strapi-plugin-sitemap#pull/65/head
npm install boazpoolman/strapi-plugin-sitemap#pull/65/head

@ericta-portfolio
Copy link
Author

ericta-portfolio commented Jan 27, 2022

Thanks! The pr seems to have fixed the bug where collections made before plugin installation didn't show!

Though, the bug where you have to re-save the individual content for it to create the proper URL still persists.
Recreation:

  1. Make and populate (with x items) Collection "Events" with UID field "eventsUID"
  2. Install Plugin
  3. URL Bundle for "Events" with pattern "/events/[eventsUID]"
  4. Generate Sitemap --> Result is "localhost:3000/events/" x times, no UID
  5. Edit and save each "Event" content (ex. add + subtract space)
  6. Generate Sitemap --> Correct result is generated

@boazpoolman
Copy link
Member

Okay! One step closer.
I’ll check out the other bug you’re describing.

@boazpoolman
Copy link
Member

Hey @ericta-portfolio

I tried to reproduce what you're describing but I wasn't able to.
If I follow your steps, at step 4 I'll see all the URLs correctly added to the sitemap.

@boazpoolman
Copy link
Member

@ericta-portfolio are you sure there is not some other reason this might be happening?

The initial problem where pre-existing records are not included is fixed with the PR.
Having the URL's in there but without the UID has to be related to something else.

@ericta-portfolio
Copy link
Author

Whoops sorry, didn't see the notification for your last response.

Hmm I'm not sure, it could be something else on my end then.
Overall, the plugin works perfectly for me now after I edited+saved the posts that didn't have the [uid] fields appear.

@boazpoolman
Copy link
Member

Allright, thanks for the input @ericta-portfolio.

I've released the PR with version v2.0.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants