<commit_before><?php

class widgetFormCompleteButtonRef extends widgetFormButtonRef
{

  public function render($name, $value = null, $attributes = array(), $errors = array())
  {
    if (isset($attributes['class'])) {
      $class = ' '.$attributes['class'];
    } else {
      $attributes['class'] = '';
      $class = '';
    }

    $values = array_merge(array('text' => '', 'is_empty' => false), is_array($value) ? $value : array());

    $input = '<div class="complete_ref">'. parent::ParentRender($name, $value, $attributes, $errors);

    $obj_name = $this->getName($value);
    if($this->getOption('default_name'))
      $obj_name = $this->getOption('default_name') ;

    $complete_options = array(
      'id' => $this->generateId($name)."_name",
      'value' => $obj_name,
      'placeholder' => $this->getOption('box_title'),
      'class' => "ref_name" . $class,
      'type'=> 'search',
    );

    if( $this->getOption('nullable')) {
      $complete_options['required'] = 'required';
    }

    $input .= $this->renderContentTag('input','',$complete_options );

    if ($this->getOption('button_class') != '') {
      $class .= ' '.$this->getOption('button_class');
    }

    if($this->getOption('button_is_hidden') && $value == 0)
    {
      $class .= ' hidden';<commit_msg>Allow send of not nullable fields<commit_after><?php

class widgetFormCompleteButtonRef extends widgetFormButtonRef
{

  public function render($name, $value = null, $attributes = array(), $errors = array())
  {
    if (isset($attributes['class'])) {
      $class = ' '.$attributes['class'];
    } else {
      $attributes['class'] = '';
      $class = '';
    }

    $values = array_merge(array('text' => '', 'is_empty' => false), is_array($value) ? $value : array());

    $input = '<div class="complete_ref">'. parent::ParentRender($name, $value, $attributes, $errors);

    $obj_name = $this->getName($value);
    if($this->getOption('default_name'))
      $obj_name = $this->getOption('default_name') ;

    $complete_options = array(
      'id' => $this->generateId($name)."_name",
      'value' => $obj_name,
      'placeholder' => $this->getOption('box_title'),
      'class' => "ref_name" . $class,
      'type'=> 'search',
    );

    if(! $this->getOption('nullable')) {
      $complete_options['required'] = 'required';
    }

    $input .= $this->renderContentTag('input','',$complete_options );

    if ($this->getOption('button_class') != '') {
      $class .= ' '.$this->getOption('button_class');
    }

    if($this->getOption('button_is_hidden') && $value == 0)
    {
      $class .= ' hidden';
{'fraction_non_alphanumeric': 0.21305182341650672, 'fraction_numerical': 0.0007677543186180423, 'mean_word_length': 3.555944055944056, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5519376', 'n_tokens_mistral': 833, 'n_tokens_neox': 814, 'n_words': 140}