Skip to content
Open
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea
/.idea
2 changes: 1 addition & 1 deletion DependencyInjection/LifoTypeaheadExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ protected function configureAsseticBundle(ContainerBuilder $container, array $co
protected function configureTwigBundle(ContainerBuilder $container, array $config)
{
if ($container->hasExtension('twig')) {
$resources = array('LifoTypeaheadBundle:Form:typeahead.html.twig');
$resources = array('@LifoTypeahead\Form\typeahead.html.twig');
if (Kernel::VERSION_ID >= '20600') {
$container->prependExtensionConfig('twig', array('form_themes' => $resources));
} else {
Expand Down
4 changes: 2 additions & 2 deletions Resources/views/Form/typeahead.html.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% block entity_typeahead_widget %}
{% spaceless %}
{% set required, main_full_name, main_id, main_value, main_attr = false, full_name, id, value, attr %}
{% set main_full_name, main_id, main_value, main_attr = full_name, id, value, attr %}

{# create visible autocomplete input #}
{% set id = main_id ~ '_text' %}
Expand Down Expand Up @@ -56,7 +56,7 @@

{% block entity_typeahead_list_widget %}
{% spaceless %}
{% if simple %}
{% if simple or child == null %}
{% set _id, _value, _render = child, child, child %}
{% else %}
{% set _id, _value, _render = child.id, attribute(child, property ?: 'id'), attribute(child, render) %}
Copy link

@ahoulgrave ahoulgrave Dec 14, 2016

Choose a reason for hiding this comment

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

here child var can be null (L31). cannot call any property without asking if null.

Expand Down
3 changes: 0 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
"email": "lifo2013@gmail.com"
}
],
"require": {
"symfony/symfony": "^2.6 || ^3.0"
},
"suggest": {
"twbs/bootstrap": "Bootstrap framework",
"mopa/bootstrap-bundle": "Bundle to automatically enable Bootstrap styles for Symfony"
Expand Down