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

Issue edit and Adding New Gallery Holder Page and Gallery Page #89

Closed
stefanok opened this issue Mar 10, 2016 · 4 comments
Closed

Issue edit and Adding New Gallery Holder Page and Gallery Page #89

stefanok opened this issue Mar 10, 2016 · 4 comments

Comments

@stefanok
Copy link

Hi guys,

The first issue is that i cant seem to add or edit existing gallery pages. When i try and do this i get this error: Error at line 145 of /public_html/sortablegridfield/code/forms/GridFieldSortableRows.php

When i look at that line it is as follows:
if(is_array($fieldType)) {
user_error('Sort column '.$this->sortColumn.' could not be found in '.$gridField->getModelClass().''s ancestry', E_USER_ERROR);
}else {
user_error('Sort column '.$this->sortColumn.' must be an Int, column is of type '.$fieldType, E_USER_ERROR);
}

2nd Issue and it is linked. On the front end, if i click on an image in the agllery i get this:
The light box opens and says this inside - Action 'photos' isn't allowed on class GalleryPage_Controller.

Any help would be appreciated, i am a noob.

@UndefinedOffset
Copy link
Owner

Lets start with the first question/issue, the two errors that you copied here mean one of two things. The first one means it couldn't find the sort column in on your related object, the second one means it's not of the type "Int". It appears you maybe using an old version because 145 is not that in the latest version in which case it could be simply that you need to define your sort column as an "Int" (case sensitive). I'm not sure which one you are seeing because those lines are not that in the latest version. Can you post some code snippets primarily how you are setting up the relationship that the gridfield is using? Something like this, if you are using a many_many relationship I'll need to see the definition of your many_many_extraFields.If you are using a has_many relationship i'll need to see the $db static on the related object.

As for your 2nd issue, you need to add "photos" to the $allowed_actions static on your GalleryPage_Controller something like this

@stefanok
Copy link
Author

Thank you so much for your reply!!! I really appreciate it!

This is what i did:
• SortOrder field was missing in GalleryImage table
• We have added it and GalleryPage_Controller was missing "photos" in allowed actions list

@UndefinedOffset
Copy link
Owner

Has that fixed the issue you were having?

@stefanok
Copy link
Author

Yes it has - thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants