Error : Cannot redeclare function

Hello everyone,

Since some days we have a bug on our Drupal PHP pages (which always worked):
Every time we want to declare a function, it triggers a bug saying that the function is already declared.
Example:
line 10: function blah(){
           ....
           ....
           ....
line 20: }

We got this error : PHP Fatal Error : cannot redeclare function blah (previously declared at line 10) in line 20

...This makes non sense, as it's the begnning and the end of the function !

Many thanks for your help
Jérôme

How to programmatically create content type with entity reference field in Drupal 8?

Hi,

I am writing a custom module that will create a content type during installation. The content type will have a title and entity reference fields. I know how to create a text fields storage using yml configuration. Here is how I am creating text field storage:

langcode: en
dependencies:
  enforced:
    module:
    - my_module
  module:
  - node
id: node.field_name
field_name: field_name
entity_type: node
type: string
settings:
max_length: 10
module: core
locked: false

Webform result calculation

Is there a way to calculate a result of the made inputs? For example for a given question there are three possible answers with one correct answer. Now there are several questions like this and I want to have a result at the end hiw many correct answers were made or the percentage.

Drupal Ajax form behavior is not working for unregistered user in node body

The form is created in own module named vkmain. Form class:

namespace Drupal\vkmain\Form;

use Drupal\Core\Form\FormStateInterface;

use Drupal\Core\Form\FormBuilderInterface;

use Drupal\Core\Form\FormBase;

use Drupal\Core\Ajax\AjaxResponse;

use Drupal\Core\Ajax\HtmlCommand;

use Drupal\Core\Url;

Session / Cache issue

Hello Everyone,

Since some days, we have a huge bug on our drupal website. It seems that some pages are stored in a sort of "persistent" cache, which won't clear when clicking on "Clear caches". On these bugged pages, it sounds like the session is not started, because the users are not considered as logged in ONLY on these buggy pages. Also, all the modifications made on these pages are not effective, even if we clear the cache.

Core Drupal Theme Preventing Upgrade to Drupal 9

I am sitting on a clean 8.9.19 site with all current contributing modules. In my wildest dreams did I think that a core theme would be the roadblock to upgrading to Drupal 9.

The site uses Bartik 8.9.19 with a sub-theme and much to my surprise Drupal 9 doesn't like it. The ironic thing is I can't install a version from a Drupal 9 package because it is not backwards compatible. So what do you do? Won't upgrade with the old and can't install a new version.

Pages

Subscribe with RSS Subscribe to RSS - Drupal 8.x