Can not create a page or a category as Admin after deploying the cloud standard website, anyone have this issue or am i missing something simple? I can create another user so I am baffled after looking through the config? Any help appreciated.
Hey @CAPTKEN - I have replicated and am looking into this 👋
@CAPTKEN we found the problem - if you go to your payload config, comment out lines
46/47
for cors/csrf and this problem should resolve. I'll be updating the template so this doesn't happen in the future!
This is fixed in the template now, pull in the changes there and it should work as expected
Thanks for the update - Jess, will give it a try tonight
@jesschow - unfortunately that not working on my end - also noticed on git - //cor: are on lines 44 and 45 you have 46 and 47
Ok deleted the cloud instance and tried again now its working
@jesschowthis seems to be not a solution. Still the issue is there.
After uncommenting those two lines and adding slug manually resolves the issue. That means the slug generator is not working with input from title field and ends up in undefined.
@jesschowmay check this and please update repository.
@jesschowAgain the save draft does not work here. I could publish directly after a slug input. Save draft returns nothing found page.
@jesschowanother guess is that PoplateArchiveBlock hook has something weired in it.
Hi @jaigo - to clarify, your issue is that after clicking 'save draft' on a page it returns the
nothing foundpage?
Yes that is for page and posts collection.
@jaigo I haven't been able to replicate this - we pushed a few updates to the template last week, can you check you have all the latest changes?
@jesschowI am talking about cloud installation. The issue is there.
@jaigo I understand that you've created this project from payload cloud - which template did you select? the website starter?
yes
@jaigo and if you start another project using the website starter, are you seeing the same issue?
yes everytime. I tried this several times after removing entirely the project and redoing. but still there is this issue. when I checkout the repo to local and change access control methods using the files available in website-cms repo and modify formatslug.ts a bit the issue is over locally. I didnt replace that remote.
@jaigo I'm trying to replicate again
@jaigo the
adminOrPublished
read access control wasn't checking the
admin
role correctly, I've pushed a fix to the repo, try that and let me know how it goes.
Or you can update the
src/access/adminOrPublished.ts
file in your repo to this:
import type { Access } from 'payload/config'
import { checkRole } from '../collections/Users/checkRole'
export const adminsOrPublished: Access = ({ req: { user } }) => {
if (user && checkRole(['admin'], user)) {
return true
}
return {
_status: {
equals: 'published',
},
}
}
Yes, That did it...!!!!. I made a direct commit to the file and tested it. Now working. Thank you for your quick response.
@jesschowThank you very much
@jaigo woo woo happy to help! 🙌
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.