Just tried installing against the latest drupal8, and here is the stack trace
looks like bootstrap_form_alter() needs an update.
here is the change record
https://www.drupal.org/node/2310411
Twig_Error_Runtime: An exception has been thrown during the rendering of a template ("Object of type "Drupal\Core\Page\HtmlPage" cannot be printed.") in "modules/bootstrap/theme/system/html.html.twig" at line 50. in Twig_Template->displayWithErrorHandling() (line 291 of /Users/martin/sites/drupal/core/vendor/twig/twig/lib/Twig/Template.php).
Twig_Template->displayWithErrorHandling(Array, Array)
Twig_Template->display(Array)
Twig_Template->render(Array)
twig_render_template('modules/bootstrap/theme/system/html.html.twig', Array)
_theme('html', Array)
drupal_render(Array)
Drupal\Core\Page\DefaultHtmlPageRenderer->render(Object)
Drupal\Core\Page\DefaultHtmlPageRenderer::renderPage('The website has encountered an error. Please try again later.', 'Error')
_drupal_log_error(Array, 1)
_drupal_error_handler_real(4096, 'Argument 2 passed to bootstrap_form_alter() must be of the type array, object given, called in /Users/martin/sites/drupal/core/lib/Drupal/Core/Theme/ThemeManager.php on line 176 and defined', '/Users/martin/sites/drupal/modules/bootstrap/theme/alter.inc', 107, Array)
_drupal_error_handler(4096, 'Argument 2 passed to bootstrap_form_alter() must be of the type array, object given, called in /Users/martin/sites/drupal/core/lib/Drupal/Core/Theme/ThemeManager.php on line 176 and defined', '/Users/martin/sites/drupal/modules/bootstrap/theme/alter.inc', 107, Array)
bootstrap_form_alter(Array, Object, 'search_block_form')
Drupal\Core\Theme\ThemeManager->alter(Array, Array, Object, 'search_block_form')
Drupal\Core\Form\FormBuilder->prepareForm('search_block_form', Array, Object)
Drupal\Core\Form\FormBuilder->buildForm('Drupal\search\Form\SearchBlockForm', Object)
Drupal\Core\Form\FormBuilder->getForm('Drupal\search\Form\SearchBlockForm')
Drupal\search\Plugin\Block\SearchBlock->build()
Drupal\block\BlockViewBuilder->buildBlock(Array)
Drupal\block\BlockViewBuilder->viewMultiple(Array, 'full', NULL)
Drupal\block\BlockViewBuilder->view(Object)
Drupal\block\Plugin\DisplayVariant\FullPageVariant->build()
block_page_build(Array)
drupal_prepare_page(Array)
Drupal\Core\Page\DefaultHtmlFragmentRenderer->render(Object)
Drupal\Core\EventSubscriber\HtmlViewSubscriber->onHtmlFragment(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object)
Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'kernel.view', Object)
Symfony\Component\EventDispatcher\EventDispatcher->dispatch('kernel.view', Object)
Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1)
Drupal\Core\DrupalKernel->handle(Object)
Comment | File | Size | Author |
---|
Comments
Comment #1
martin107 CreditAttribution: martin107 commented1) HOOK_form_alter now has these function arguments
hook_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id)
In general this module needs some TLC with regard to how it handles forms.
BUT for now I would like to limit the scope of this issue to clearing the errors.
Comment #2
yuradoc CreditAttribution: yuradoc commentedHello. I tried to install this theme on D8-beta1.
I've got the mostly the same errors described here.
I use patch listed here and some errors have gone, but this one is still here:
Twig_Error_Runtime: An exception has been thrown during the rendering of a template ("Object of type "Drupal\Core\Page\HtmlPage" cannot be printed.") in "sites/all/themes/bootstrap/theme/system/html.html.twig" at line 46. in Twig_Template->displayWithErrorHandling() (line 291 of /opt/lampp/htdocs/drupal8-beta1/core/vendor/twig/twig/lib/Twig/Template.php).
It happends two times logged in system logs per page load.
Comment #3
martin107 CreditAttribution: martin107 commentedadding change record.
Comment #4
markhalliwellThis theme isn't anywhere close to being testable. Modules should be upgraded now that 8.0.0-beta1 is out, not themes (there's still a lot of working being done on the theme system in core).
Comment #5
markhalliwellAlso, after briefly looking at the patch I would have to say that this issue needs more work. Just changing the function signatures won't help.
$form_state
is a class now, not an array so the code inside the functions will not work and possibly even cause fatal errors.Comment #6
yuradoc CreditAttribution: yuradoc commentedI made a patch that makes theme working (testable) for me and no errors appears in syslog.
I don't know D8 theme system good, but I used core themes for comparison.
Comment #7
yuradoc CreditAttribution: yuradoc commentedComment #9
yuradoc CreditAttribution: yuradoc commentedSorry, I forget about --relative flag, when made git diff.
Comment #10
yuradoc CreditAttribution: yuradoc commentedComment #11
markhalliwellThis is what I am talking about: https://www.drupal.org/node/2310411. "$form_state" used to be an array, now it's a classed object.
This line would need to be changed to:
$form_state->getBuildInfo()['args'][0]
, but I'm sure there are others in the alter.inc file like this.Also, the changes made in the html.html.twig file is not part of this issue.
Comment #12
yuradoc CreditAttribution: yuradoc commentedI think that changes at html.html.twig is a part of the original pb.
Take a look at the errors stack.
Please make double check of the patch provided. Patch makes changes variables names to correct one like in core themes.
After that I haven't such error messages in the syslog.
The pb you listed about $form_state possibly needs to be resolved, but errors I think that listed here doesn't related to this pb only.
Comment #13
markhalliwellIt doesn't matter, changing a template file is a separate issue. The very first paragraph or so of the issue summary states:
Any given issue should be about one thing and one thing only. This one is about the form alters and how
$form_state
changed. If you want to create a separate issue about the html.html.twig page changes, please do. Tracking separate issues is easier for everyone.Comment #14
yuradoc CreditAttribution: yuradoc commentedOk, no metter. I found this issue by this error. And it helped me to resolve the pb.
Comment #15
markhalliwellI'm not entirely sure what you mean by "pb", but here is an updated patch that actually changes the
$form_state
inside the functions too, not just in the signature.Comment #16
martin107 CreditAttribution: martin107 commentedMinor nitpick, I have added a forward slash before Drupal::moduleHandler()
So next manual testing, there was a WDOS issue with admin/appearance/settings/bootstrap
which I corrected using the change record.
https://www.drupal.org/node/2346779
l() and url() are deprecated in favor of a routing based URL generation API.
and also
https://www.drupal.org/node/2219113
drupal_json_encode() and drupal_json_decode() moved to \Drupal\Component\Serialization\Json
If you consider this a gross over-extension of this issue then I understand, please let me know ... and will create a separate issue.
I see that as a mild paradox as It is difficult to clear and verify one set of issues without first resolving the other set.
Comment #17
markhalliwellThis related issue has taken care of this. Form alters should now implement the
@BootstrapForm
annotation plugin.