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

[GeneratorBundle] Fixed Page(part) generating #2382

Merged
merged 1 commit into from Feb 26, 2019

Conversation

jeroenjans
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Fixed tickets

This PR fixes some problems when generating a Page(part).

The error that was reported was:

In ExtraFunctions.php line 26:
                                                                                                    
  Impossible to invoke a method ("getName") on a string variable ("TestWebsiteBundle").  

And

In ExtraFunctions.php line 8:
                                                                                                                                                                                                           
  An exception has been thrown during the rendering of a template ("Catchable Fatal Error: Object of class Test\WebsiteBundle\TestWebsiteBundle could not be converted to string").  
                                                                                                                                                                                                           

In Environment.php(378) : eval()'d code line 33:
                                                                                                                                      
  Catchable Fatal Error: Object of class Test\WebsiteBundle\TestWebsiteBundle could not be converted to string  

Another possible solution would be to modify the Entity/Pages/ExtraFunctions.php file so that it's using {{ bundle }} instead of {{ bundle.getName() }}.
If this is the desired fix then let me know and I'll change the PR accordingly.

Copy link

@ProfessorKuma ProfessorKuma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jeroenjans, your PR needs some changes

  • It seems that you should have submitted to the latest minor branch.
  • This PR seems to need a milestone of a patch release.

@ProfessorKuma ProfessorKuma added this to the 5.2.3 milestone Feb 23, 2019
@jeroenjans jeroenjans changed the base branch from master to 5.2 February 23, 2019 22:13
@acrobat
Copy link
Member

acrobat commented Feb 25, 2019

Hi @jeroenjans,

Thanks for this bugfix! This bug was caused by changes in PR #2235. There was a incorrect change for sf4 made. The correct fix would to change the check in the ExtraFunction.php from

{% if not isV4 %}{{ bundle.getName() }}:{%endif%}

To

{% if not isV4 %}{{ bundle }}:{%endif%}

Can you update your pr to revert to current fix and implement the suggested fix in ExtraFunctions.php? Thanks!

@jeroenjans
Copy link
Contributor Author

Hey @acrobat,

I've updated the PR according to the feedback.
Let me know if I need to change anything else!

@acrobat acrobat merged commit 8dff07a into Kunstmaan:5.2 Feb 26, 2019
@acrobat
Copy link
Member

acrobat commented Feb 26, 2019

Thanks @jeroenjans!

acrobat added a commit that referenced this pull request Mar 3, 2019
* 5.2:
  [AdminBundle] alignment of date, time & datetime widgets (#2389)
  [NodeBundle] fixed multilanguage parameter in WidgetController (#2387)
  Don't call getName() on the actual bundle name (#2382)
  [GeneratorBundle] fixed multilanguage parameter in article generator (#2385)
  [NodeBundle] Fix incorrect routing config for controller-as-service (#2369)
  [TranslatorBundle] fixed sf4 translations issue (#2367)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants