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

Exception thrown when title_format uses multiple select field #6870

Closed
trigau opened this issue Jul 31, 2017 · 3 comments
Closed

Exception thrown when title_format uses multiple select field #6870

trigau opened this issue Jul 31, 2017 · 3 comments

Comments

@trigau
Copy link

trigau commented Jul 31, 2017

Well, actually I don't know what would be the normal behaviour, but sure I didn't expect it to be an error.

To sum up : thanks to recent improvements, I was able to use a select field in title_format... until I change "multiple" attribute of my select field.

Suggestion : instead of throwing an error, perhaps just don't use select field in title if ther is more thant one item selected.

Details

  • Relevant Bolt Version: 3.3

Reproduction

  1. Bug summary:
    • title_format can use select field type
    • but if multiple attribute of this field type is set to true, an error is thrown in backend listing
  2. Specifics:
    • Here is the error message :
      Twig_Error_Runtime in Template.php line 447: An exception has been thrown during the rendering of a template ("Warning: strip_tags() expects parameter 1 to be string, array given") in "@bolt/_nav/_secondary-content.twig" at line 28.
  3. Steps to reproduce:
    • Create a new Contenttype
    • Add a field with type "select"
    • Add attribute "multiple: true" to this field
    • Add attribute "title_format: [selectfieldname] to contenttype
    • Update database ad go to backend listing of your new contenttype
  4. Expected result:
    • If multiple is not set to true, listing throws no error and title format uses select field normally
  5. Actual result:
    • When multiple is set to true, an error is thrown
@trigau trigau changed the title [BUG] exception thrown when titl_format uses multiple select field [BUG] exception thrown when title_format uses multiple select field Jul 31, 2017
@SvanteRichter
Copy link
Contributor

Suggestion : instead of throwing an error, perhaps just don't use select field in title if ther is more thant one item selected.

Wouldn't that just be even weirder? As in you configure something and bolt would just ignore it?

IMO this isn't a bug, it's just what happens when you try to print an array as a string.

@trigau
Copy link
Author

trigau commented Aug 6, 2017

Well it could sound weird. The other option is to display all the values stored in the select field.

I think it could be viewed as a bug, because this is allowed and doesn't work. So either it shouldn't be allowed, or it should work, isn't it ?

@GwendolenLynch GwendolenLynch changed the title [BUG] exception thrown when title_format uses multiple select field Exception thrown when title_format uses multiple select field Sep 27, 2017
@GwendolenLynch
Copy link
Contributor

#7067

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