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

Datasource group by author causes fatal error #1855

Closed
jensscherbl opened this issue Nov 1, 2013 · 5 comments
Closed

Datasource group by author causes fatal error #1855

jensscherbl opened this issue Nov 1, 2013 · 5 comments
Assignees

Comments

@jensscherbl
Copy link
Member

When grouping a datasource by Author and no Author field exists in this section, I get the following error in the frontend where the datasource is included:

Fatal error: Call to a member function groupRecords() on a non-object in .../symphony/lib/toolkit/data-sources/class.datasource.section.php on line 516

I looked into the code and it looks like the Author option is showing up on purpose, even if no Author field exists, but I don't understand the code well enough to fix it myself.

That's Symphony 2.3.4, by the way.

@iwyg
Copy link
Contributor

iwyg commented Nov 1, 2013

can you drop the line?

@jensscherbl
Copy link
Member Author

can you drop the line?

I don't think the real problem is in class.datasource.section.php where the error is actually thrown.

I guess it's something in content.blueprintsdatasources.php, but not sure about it.

@jensscherbl
Copy link
Member Author

Now it's getting even more interesting.

If I add an Author field and resave the datasource, I get the following in my XML output.

<error>Data source output grouping is not supported by the <code>Author</code> field on 1049 of file .../symphony/lib/toolkit/class.field.php</error>

Also, there's no empty option in the Author field select box when the field is required. Not a real problem, but not consistent with the Select Box and Select Box Link fields.

@ghost ghost assigned brendo Nov 9, 2013
@brendo
Copy link
Member

brendo commented Nov 14, 2013

There's a bit of weirdness here.

  • The Author field can only group when allow multiple selection is allowed
  • Grouping should only happen when the Author field exists (bug)
  • The Author field doesn't implement the groupRecords function (bug) so it falls back to the the default Field implementation which is throwing an unsupported exception

It appears all these bugs have been there for some time! Resolving now.

brendo added a commit that referenced this issue Nov 14, 2013
@jensscherbl
Copy link
Member Author

Thanks. Just stumbled over this while fixing a bug in (and testing) my multilingual extension.

@brendo brendo closed this as completed Nov 26, 2013
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

3 participants