Slide Show

After an upgrade the front page of a site is giving Notice: Undefined variable: rendered_rows in include() (line 15 of /var/www/vhosts/ According to Google clearing cache is suppose to solve it but that hasn’t made any difference, At the moment I am stumped. Thanks It[…]

Routing error

I am getting DrupalComponentSerializationExceptionInvalidDataTypeException: Unable to parse at line 6 (near ” requirements This is my routing file competition.form: path: ‘/competition/CompetitionForm’ defaults: _title: ” _form: ‘DrupalcompetitionFormCompetitionForm’ requirements: _permission: ‘access content’ This is the first time I have used Drupal 8 and I have no idea[…]

Form Builder

I am getting InvalidArgumentException: The form argument DrupalcompetitionFormCompetitionForm::class is not a valid form. in DrupalCoreFormFormBuilder->getFormId() (line 190 of /home/test/public_html/core/lib/Drupal/Core/Form/FormBuilder.php). This is my call in the block code public function build() { $builtForm = Drupal::formBuilder()->getForm(‘DrupalcompetitionFormCompetitionForm::class’); $renderArray[‘form’] = $builtForm; return $renderArray; } This the first part of[…]

Form validation

This is my form field $form[‘loyalty_code’] = array ( ‘#name’ => ‘loyalty_code’, ‘#id’ => ‘loyalty_code’, ‘#type’ => ‘textfield’, ‘#title’ => (‘LOYALTY CODE’), ‘#required’ => TRUE, ‘#prefix’ => ‘<hr> <div class=”label-wrap loyalty-code”>’, ‘#suffix’ => ‘</div>’, ); This is my validation public function validateForm(array &$form, FormStateInterface $form_state)[…]

form alter

I am trying to add some addition coding to  the user registration form and profile form function register_with_sugar_crm_form_alter(&$form, &$form_state, $form_id) { if ($form_id == “user_register_form” | $form_id == “user_profile_form”) { $form[‘actions’][‘submit’][‘#submit’][] = ‘send_details_to_sugar_crm’; } } It is doing send_details_to_sugar_crm alright. The problem is that it[…]

Managed File Upload

I have $form[‘attachment1’] = array( ‘#type’ => ‘managed_file’, ‘#name’ => ‘attachment1’, ‘#id’ => ‘attachment1’, ‘#upload_location’ => ‘public://form_documents’, ‘#upload_validators’ => array( ‘file_validate_extensions’ => array(‘pdf doc docx’), ‘file_validate_name’ => array() ), ‘#title’ => t(‘Attachment’), ‘#prefix’ => ‘ ‘, ‘#suffix’ => ‘ ‘ ); The problem is that[…]