diff --git a/.drone.yml b/.drone.yml index bc123a89b..c013abb8e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -48,31 +48,14 @@ pipeline: - npm install --unsafe-perm - NODE_ENV=production npm run production - composer-install-highest: - group: post-prepare - image: registry.fpfis.eu/fpfis/httpd-php:${PHP_VERSION}-ci - volumes: - - /cache:/cache - commands: - - composer self-update --2 - - composer install --ansi --no-progress - when: - matrix: - COMPOSER_BOUNDARY: highest - - composer-update-lowest: - group: post-prepare + composer-install: + group: prepare image: registry.fpfis.eu/fpfis/httpd-php:${PHP_VERSION}-ci volumes: - - /cache:/cache + - /cache/${DRONE_REPO_NAME}:/cache commands: - composer self-update --2 - - composer update --prefer-lowest --prefer-stable --ansi --no-progress - when: - event: - exclude: tag - matrix: - COMPOSER_BOUNDARY: lowest + - composer require drupal/core:~${CORE_VERSION} drupal/core-composer-scaffold:~${CORE_VERSION} --update-with-all-dependencies --ansi --no-progress --no-interaction site-install: image: registry.fpfis.eu/fpfis/httpd-php:${PHP_VERSION}-ci @@ -112,8 +95,8 @@ pipeline: when: event: tag matrix: - COMPOSER_BOUNDARY: highest - PHP_VERSION: 7.4 + CORE_VERSION: "9.4.0" + PHP_VERSION: "8.0" github-release: image: registry.fpfis.eu/drone-plugins/github-release @@ -124,13 +107,13 @@ pipeline: when: event: tag matrix: - COMPOSER_BOUNDARY: highest - PHP_VERSION: 7.4 + CORE_VERSION: "9.4.0" + PHP_VERSION: "8.0" matrix: - COMPOSER_BOUNDARY: - - lowest - - highest + CORE_VERSION: + - 9.4.0 + - 9.5.0 PHP_VERSION: - - 7.4 - 8.0 + - 8.1 diff --git a/composer.json b/composer.json index 9811d1377..591a8197c 100644 --- a/composer.json +++ b/composer.json @@ -6,37 +6,31 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": ">=7.4", + "php": ">=8.0", "cweagans/composer-patches": "^1.7", - "drupal/core": "^9.3", + "drupal/core": "^9.4", "drupal/daterange_compact": "^2.0", "drupal/twig_field_value": "^2.0", "openeuropa/composer-artifacts": "^1.0.0-alpha1", - "openeuropa/oe_bootstrap_theme": "^1.1.0" + "openeuropa/oe_bootstrap_theme": "^1.3.0" }, "require-dev": { "composer/installers": "^1.11", "drupal/better_exposed_filters": "^5.0", "drupal/composite_reference": "^2.1", "drupal/config_devel": "~1.2", - "drupal/core-composer-scaffold": "^9.3", - "drupal/core-dev": "^9.3", - "drupal/ctools": "^3.7", + "drupal/core-composer-scaffold": "^9.4", + "drupal/core-dev": "^9.4", "drupal/description_list_field": "^1.0@alpha", - "drupal/drupal-extension": "~4.1", "drupal/entity_reference_revisions": "^1.9", "drupal/extra_field": "^2.1", "drupal/facets_form": "1.0.0-alpha3", "drupal/field_group": "^3.2", - "drupal/inline_entity_form": "^1.0-rc12", "drupal/search_api": "^1.21", "drupal/search_api_autocomplete": "^1.5", - "drupal/token": "^1.10", - "drupal/typed_link": "^2.0", - "drush/drush": "^10.3", - "easyrdf/easyrdf": "1.0.0 as 0.9.1", - "league/csv": "^9.1", - "nikic/php-parser": "^4.13", + "drupal/typed_link": "^2.0.1", + "drush/drush": "^11.1", + "mikey179/vfsstream": "^1.6.10", "openeuropa/code-review": "^2.0", "openeuropa/oe_authentication": "^1.8", "openeuropa/oe_contact_forms": "~1.5", @@ -44,12 +38,11 @@ "openeuropa/oe_content_extra": "^1.0.0-beta2", "openeuropa/oe_corporate_blocks": "^4.8", "openeuropa/oe_list_pages": "^0.20", - "openeuropa/oe_multilingual": "^1.11", + "openeuropa/oe_multilingual": "^1.14", "openeuropa/oe_paragraphs": "^1.17", "openeuropa/oe_starter_content": "^1.0.0", - "openeuropa/task-runner-drupal-project-symlink": "^1.0-beta5", - "phpspec/prophecy-phpunit": "^2", - "symfony/dom-crawler": "^4.4.12" + "openeuropa/task-runner-drupal-project-symlink": "^1.0-beta6", + "phpspec/prophecy-phpunit": "^2" }, "scripts": { "post-install-cmd": "./vendor/bin/run drupal:site-setup", @@ -92,18 +85,18 @@ "https://www.drupal.org/project/entity_reference_revisions/issues/2937835": "https://www.drupal.org/files/issues/2021-03-26/entity_reference_revisions-field_formatter_label-2937835-36.patch" } }, + "patches-ignore": { + "openeuropa/oe_content": { + "drupal/typed_link": { + "Outdated": "https://www.drupal.org/files/issues/2022-02-09/typed_link_constraints-3263477-2.patch" + } + } + }, "drupal-scaffold": { "locations": { "web-root": "./build" } }, - "_readme": [ - "Explicit minimum version requirement of drupal/ctools module due to D9.3 compatibility.", - "Explicit requirement for league/csv due to PHP 8.0 compatibility", - "Explicit minimum version requirement for symfony/dom-crawler due to its lower versions using the deprecated function libxml_disable_entity_loader() in PHP8.", - "Explicit requirement of token module due to PHP 8 compatbility.", - "Explicit minimum version requirement of drupal/inline_entity_form due to failing patch in lower versions. To be removed once oe_media required the same minimum version." - ], "installer-paths": { "build/core": [ "type:drupal-core" diff --git a/docker-compose.yml b/docker-compose.yml index 1b7cab0b7..75e5a6f5e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '2' services: web: - image: fpfis/httpd-php-dev:8.0 + image: fpfis/httpd-php-dev:8.1 working_dir: /var/www/html ports: - 8080:8080 diff --git a/modules/oe_whitelabel_extra_project/config/install/core.entity_view_display.node.oe_project.full.yml b/modules/oe_whitelabel_extra_project/config/install/core.entity_view_display.node.oe_project.full.yml index 8088900d9..4ec06b28d 100644 --- a/modules/oe_whitelabel_extra_project/config/install/core.entity_view_display.node.oe_project.full.yml +++ b/modules/oe_whitelabel_extra_project/config/install/core.entity_view_display.node.oe_project.full.yml @@ -18,6 +18,8 @@ dependencies: - field.field.node.oe_project.oe_project_contact - field.field.node.oe_project.oe_project_coordinators - field.field.node.oe_project.oe_project_dates + - field.field.node.oe_project.oe_project_eu_budget + - field.field.node.oe_project.oe_project_eu_contrib - field.field.node.oe_project.oe_project_funding_programme - field.field.node.oe_project.oe_project_locations - field.field.node.oe_project.oe_project_participants @@ -65,13 +67,13 @@ third_party_settings: label: Coordinators parent_name: group_project_details region: content - weight: 3 + weight: 11 format_type: oe_whitelabel_helper_description_list_pattern format_settings: { } group_budget: children: - - oe_project_budget - - oe_project_budget_eu + - extra_field_oe_whitelabel_extra_project_project_budget + - extra_field_oe_whitelabel_extra_project_eu_contrib label: Budget parent_name: '' region: content @@ -96,7 +98,7 @@ third_party_settings: label: Website parent_name: group_project_details region: content - weight: 2 + weight: 10 format_type: oe_whitelabel_helper_description_list_pattern format_settings: { } id: node.oe_project.full @@ -104,6 +106,16 @@ targetEntityType: node bundle: oe_project mode: full content: + extra_field_oe_whitelabel_extra_project_eu_contrib: + settings: { } + third_party_settings: { } + weight: 6 + region: content + extra_field_oe_whitelabel_extra_project_project_budget: + settings: { } + third_party_settings: { } + weight: 5 + region: content oe_cx_achievements_and_milestone: type: text_default label: hidden @@ -134,28 +146,6 @@ content: third_party_settings: { } weight: 4 region: content - oe_project_budget: - type: number_decimal - label: hidden - settings: - thousand_separator: . - decimal_separator: ',' - scale: 2 - prefix_suffix: true - third_party_settings: { } - weight: 2 - region: content - oe_project_budget_eu: - type: number_decimal - label: hidden - settings: - thousand_separator: . - decimal_separator: ',' - scale: 2 - prefix_suffix: true - third_party_settings: { } - weight: 3 - region: content oe_project_coordinators: type: entity_reference_revisions_label label: hidden @@ -209,7 +199,7 @@ content: settings: link_to_entity: false third_party_settings: { } - weight: 5 + weight: 6 region: content oe_summary: type: text_default @@ -230,10 +220,15 @@ hidden: oe_departments: true oe_documents: true oe_featured_media: true + oe_project_budget: true + oe_project_budget_eu: true oe_project_calls: true oe_project_contact: true + oe_project_eu_budget: true + oe_project_eu_contrib: true oe_project_locations: true oe_project_result_files: true oe_project_results: true oe_subject: true oe_teaser: true + search_api_excerpt: true diff --git a/modules/oe_whitelabel_extra_project/config/install/core.entity_view_display.node.oe_project.oe_w_content_banner.yml b/modules/oe_whitelabel_extra_project/config/install/core.entity_view_display.node.oe_project.oe_w_content_banner.yml index d55324162..107c91138 100644 --- a/modules/oe_whitelabel_extra_project/config/install/core.entity_view_display.node.oe_project.oe_w_content_banner.yml +++ b/modules/oe_whitelabel_extra_project/config/install/core.entity_view_display.node.oe_project.oe_w_content_banner.yml @@ -18,6 +18,8 @@ dependencies: - field.field.node.oe_project.oe_project_contact - field.field.node.oe_project.oe_project_coordinators - field.field.node.oe_project.oe_project_dates + - field.field.node.oe_project.oe_project_eu_budget + - field.field.node.oe_project.oe_project_eu_contrib - field.field.node.oe_project.oe_project_funding_programme - field.field.node.oe_project.oe_project_locations - field.field.node.oe_project.oe_project_participants @@ -55,6 +57,8 @@ content: region: content hidden: body: true + extra_field_oe_whitelabel_extra_project_eu_contrib: true + extra_field_oe_whitelabel_extra_project_project_budget: true langcode: true links: true oe_content_content_owner: true @@ -75,6 +79,8 @@ hidden: oe_project_contact: true oe_project_coordinators: true oe_project_dates: true + oe_project_eu_budget: true + oe_project_eu_contrib: true oe_project_funding_programme: true oe_project_locations: true oe_project_participants: true @@ -83,3 +89,4 @@ hidden: oe_project_website: true oe_reference_code: true oe_summary: true + search_api_excerpt: true diff --git a/modules/oe_whitelabel_extra_project/config/install/core.entity_view_display.node.oe_project.teaser.yml b/modules/oe_whitelabel_extra_project/config/install/core.entity_view_display.node.oe_project.teaser.yml index acf603362..513ec1229 100644 --- a/modules/oe_whitelabel_extra_project/config/install/core.entity_view_display.node.oe_project.teaser.yml +++ b/modules/oe_whitelabel_extra_project/config/install/core.entity_view_display.node.oe_project.teaser.yml @@ -18,6 +18,8 @@ dependencies: - field.field.node.oe_project.oe_project_contact - field.field.node.oe_project.oe_project_coordinators - field.field.node.oe_project.oe_project_dates + - field.field.node.oe_project.oe_project_eu_budget + - field.field.node.oe_project.oe_project_eu_contrib - field.field.node.oe_project.oe_project_funding_programme - field.field.node.oe_project.oe_project_locations - field.field.node.oe_project.oe_project_participants @@ -44,7 +46,7 @@ third_party_settings: label: Stakeholders parent_name: '' region: hidden - weight: 30 + weight: 35 format_type: html_element format_settings: classes: '' @@ -96,6 +98,8 @@ content: region: content hidden: body: true + extra_field_oe_whitelabel_extra_project_eu_contrib: true + extra_field_oe_whitelabel_extra_project_project_budget: true langcode: true links: true oe_content_content_owner: true @@ -114,6 +118,8 @@ hidden: oe_project_calls: true oe_project_contact: true oe_project_coordinators: true + oe_project_eu_budget: true + oe_project_eu_contrib: true oe_project_funding_programme: true oe_project_locations: true oe_project_participants: true @@ -122,3 +128,4 @@ hidden: oe_project_website: true oe_reference_code: true oe_summary: true + search_api_excerpt: true diff --git a/modules/oe_whitelabel_extra_project/config/overrides/core.entity_form_display.node.oe_project.default.yml b/modules/oe_whitelabel_extra_project/config/overrides/core.entity_form_display.node.oe_project.default.yml index cf518277a..194926ee2 100644 --- a/modules/oe_whitelabel_extra_project/config/overrides/core.entity_form_display.node.oe_project.default.yml +++ b/modules/oe_whitelabel_extra_project/config/overrides/core.entity_form_display.node.oe_project.default.yml @@ -17,6 +17,8 @@ dependencies: - field.field.node.oe_project.oe_project_contact - field.field.node.oe_project.oe_project_coordinators - field.field.node.oe_project.oe_project_dates + - field.field.node.oe_project.oe_project_eu_budget + - field.field.node.oe_project.oe_project_eu_contrib - field.field.node.oe_project.oe_project_funding_programme - field.field.node.oe_project.oe_project_locations - field.field.node.oe_project.oe_project_participants @@ -55,8 +57,8 @@ third_party_settings: required_fields: true group_budget: children: - - oe_project_budget - - oe_project_budget_eu + - oe_project_eu_budget + - oe_project_eu_contrib label: Budget region: content parent_name: group_details @@ -170,20 +172,6 @@ content: size: 60 placeholder: '' third_party_settings: { } - oe_project_budget: - type: number - weight: 9 - region: content - settings: - placeholder: '' - third_party_settings: { } - oe_project_budget_eu: - type: number - weight: 10 - region: content - settings: - placeholder: '' - third_party_settings: { } oe_project_coordinators: type: inline_entity_form_complex weight: 10 @@ -211,6 +199,20 @@ content: date_order: DMY time_type: none third_party_settings: { } + oe_project_eu_budget: + type: number + weight: 0 + region: content + settings: + placeholder: '' + third_party_settings: { } + oe_project_eu_contrib: + type: number + weight: 2 + region: content + settings: + placeholder: '' + third_party_settings: { } oe_project_funding_programme: type: skos_concept_entity_reference_autocomplete weight: 8 @@ -328,6 +330,8 @@ hidden: oe_content_navigation_title: true oe_content_short_title: true oe_departments: true + oe_project_budget: true + oe_project_budget_eu: true oe_project_calls: true oe_project_contact: true oe_project_locations: true diff --git a/modules/oe_whitelabel_extra_project/config/post_updates/00001_decimal_budget_fields/core.entity_form_display.node.oe_project.default.yml b/modules/oe_whitelabel_extra_project/config/post_updates/00001_decimal_budget_fields/core.entity_form_display.node.oe_project.default.yml new file mode 100644 index 000000000..194926ee2 --- /dev/null +++ b/modules/oe_whitelabel_extra_project/config/post_updates/00001_decimal_budget_fields/core.entity_form_display.node.oe_project.default.yml @@ -0,0 +1,341 @@ +langcode: en +status: true +dependencies: + config: + - field.field.node.oe_project.body + - field.field.node.oe_project.oe_cx_achievements_and_milestone + - field.field.node.oe_project.oe_cx_gallery + - field.field.node.oe_project.oe_cx_impacts + - field.field.node.oe_project.oe_cx_lead_contributors + - field.field.node.oe_project.oe_cx_objective + - field.field.node.oe_project.oe_departments + - field.field.node.oe_project.oe_documents + - field.field.node.oe_project.oe_featured_media + - field.field.node.oe_project.oe_project_budget + - field.field.node.oe_project.oe_project_budget_eu + - field.field.node.oe_project.oe_project_calls + - field.field.node.oe_project.oe_project_contact + - field.field.node.oe_project.oe_project_coordinators + - field.field.node.oe_project.oe_project_dates + - field.field.node.oe_project.oe_project_eu_budget + - field.field.node.oe_project.oe_project_eu_contrib + - field.field.node.oe_project.oe_project_funding_programme + - field.field.node.oe_project.oe_project_locations + - field.field.node.oe_project.oe_project_participants + - field.field.node.oe_project.oe_project_result_files + - field.field.node.oe_project.oe_project_results + - field.field.node.oe_project.oe_project_website + - field.field.node.oe_project.oe_reference_code + - field.field.node.oe_project.oe_subject + - field.field.node.oe_project.oe_summary + - field.field.node.oe_project.oe_teaser + - node.type.oe_project + module: + - datetime_range + - field_group + - inline_entity_form + - link + - oe_content_featured_media_field + - rdf_skos + - text +third_party_settings: + field_group: + group_result: + children: + - oe_project_results + - oe_project_result_files + label: Result + region: content + parent_name: '' + weight: 13 + format_type: details + format_settings: + classes: '' + id: '' + open: true + description: '' + required_fields: true + group_budget: + children: + - oe_project_eu_budget + - oe_project_eu_contrib + label: Budget + region: content + parent_name: group_details + weight: 6 + format_type: tab + format_settings: + classes: '' + id: '' + formatter: open + description: '' + required_fields: true + group_details: + children: + - oe_project_dates + - group_budget + - oe_project_website + - oe_project_funding_programme + - oe_reference_code + - oe_project_coordinators + label: 'Project details' + region: content + parent_name: '' + weight: 4 + format_type: html_element + format_settings: + classes: '' + show_empty_fields: false + id: '' + element: div + show_label: true + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + required_fields: true +id: node.oe_project.default +targetEntityType: node +bundle: oe_project +mode: default +content: + oe_cx_achievements_and_milestone: + type: text_textarea + weight: 10 + region: content + settings: + rows: 5 + placeholder: '' + third_party_settings: { } + oe_cx_gallery: + type: entity_reference_autocomplete + weight: 11 + region: content + settings: + match_operator: CONTAINS + match_limit: 10 + size: 60 + placeholder: '' + third_party_settings: { } + oe_cx_impacts: + type: text_textarea + weight: 7 + region: content + settings: + rows: 5 + placeholder: '' + third_party_settings: { } + oe_cx_lead_contributors: + type: inline_entity_form_complex + weight: 9 + region: content + settings: + form_mode: default + override_labels: false + label_singular: '' + label_plural: '' + allow_new: true + allow_existing: false + match_operator: CONTAINS + allow_duplicate: false + collapsible: false + collapsed: false + revision: false + removed_reference: optional + third_party_settings: { } + oe_cx_objective: + type: text_textarea + weight: 6 + region: content + settings: + rows: 5 + placeholder: '' + third_party_settings: { } + oe_documents: + type: entity_reference_autocomplete + weight: 12 + region: content + settings: + match_operator: CONTAINS + match_limit: 10 + size: 60 + placeholder: '' + third_party_settings: { } + oe_featured_media: + type: oe_featured_media_autocomplete + weight: 1 + region: content + settings: + match_operator: CONTAINS + match_limit: 10 + size: 60 + placeholder: '' + third_party_settings: { } + oe_project_coordinators: + type: inline_entity_form_complex + weight: 10 + region: content + settings: + form_mode: default + override_labels: false + label_singular: '' + label_plural: '' + allow_new: true + allow_existing: false + match_operator: CONTAINS + allow_duplicate: false + collapsible: false + collapsed: false + revision: false + removed_reference: optional + third_party_settings: { } + oe_project_dates: + type: daterange_datelist + weight: 5 + region: content + settings: + increment: 15 + date_order: DMY + time_type: none + third_party_settings: { } + oe_project_eu_budget: + type: number + weight: 0 + region: content + settings: + placeholder: '' + third_party_settings: { } + oe_project_eu_contrib: + type: number + weight: 2 + region: content + settings: + placeholder: '' + third_party_settings: { } + oe_project_funding_programme: + type: skos_concept_entity_reference_autocomplete + weight: 8 + region: content + settings: + match_operator: CONTAINS + match_limit: 10 + size: 60 + placeholder: '' + third_party_settings: { } + oe_project_participants: + type: inline_entity_form_complex + weight: 8 + region: content + settings: + form_mode: default + override_labels: true + label_singular: participant + label_plural: participants + allow_new: true + allow_existing: false + match_operator: CONTAINS + allow_duplicate: false + collapsible: true + collapsed: false + revision: true + removed_reference: keep + third_party_settings: { } + oe_project_result_files: + type: entity_reference_autocomplete + weight: 0 + region: content + settings: + match_operator: CONTAINS + match_limit: 10 + size: 60 + placeholder: '' + third_party_settings: { } + oe_project_results: + type: text_textarea + weight: 0 + region: content + settings: + rows: 5 + placeholder: '' + third_party_settings: { } + oe_project_website: + type: link_default + weight: 7 + region: content + settings: + placeholder_url: '' + placeholder_title: '' + third_party_settings: { } + oe_reference_code: + type: string_textfield + weight: 9 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } + oe_subject: + type: skos_concept_entity_reference_autocomplete + weight: 3 + region: content + settings: + match_operator: CONTAINS + match_limit: 10 + size: 60 + placeholder: '' + third_party_settings: { } + oe_summary: + type: text_textarea + weight: 5 + region: content + settings: + rows: 5 + placeholder: '' + third_party_settings: { } + oe_teaser: + type: text_textarea + weight: 2 + region: content + settings: + rows: 5 + placeholder: '' + third_party_settings: { } + status: + type: boolean_checkbox + weight: 14 + region: content + settings: + display_label: true + third_party_settings: { } + title: + type: string_textfield + weight: 0 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } + translation: + weight: 10 + region: content + settings: { } + third_party_settings: { } +hidden: + body: true + created: true + langcode: true + oe_content_content_owner: true + oe_content_legacy_link: true + oe_content_navigation_title: true + oe_content_short_title: true + oe_departments: true + oe_project_budget: true + oe_project_budget_eu: true + oe_project_calls: true + oe_project_contact: true + oe_project_locations: true + path: true + promote: true + sticky: true + uid: true diff --git a/modules/oe_whitelabel_extra_project/config/post_updates/00001_decimal_budget_fields/core.entity_view_display.node.oe_project.full.yml b/modules/oe_whitelabel_extra_project/config/post_updates/00001_decimal_budget_fields/core.entity_view_display.node.oe_project.full.yml new file mode 100644 index 000000000..4ec06b28d --- /dev/null +++ b/modules/oe_whitelabel_extra_project/config/post_updates/00001_decimal_budget_fields/core.entity_view_display.node.oe_project.full.yml @@ -0,0 +1,234 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.full + - field.field.node.oe_project.body + - field.field.node.oe_project.oe_cx_achievements_and_milestone + - field.field.node.oe_project.oe_cx_gallery + - field.field.node.oe_project.oe_cx_impacts + - field.field.node.oe_project.oe_cx_lead_contributors + - field.field.node.oe_project.oe_cx_objective + - field.field.node.oe_project.oe_departments + - field.field.node.oe_project.oe_documents + - field.field.node.oe_project.oe_featured_media + - field.field.node.oe_project.oe_project_budget + - field.field.node.oe_project.oe_project_budget_eu + - field.field.node.oe_project.oe_project_calls + - field.field.node.oe_project.oe_project_contact + - field.field.node.oe_project.oe_project_coordinators + - field.field.node.oe_project.oe_project_dates + - field.field.node.oe_project.oe_project_eu_budget + - field.field.node.oe_project.oe_project_eu_contrib + - field.field.node.oe_project.oe_project_funding_programme + - field.field.node.oe_project.oe_project_locations + - field.field.node.oe_project.oe_project_participants + - field.field.node.oe_project.oe_project_result_files + - field.field.node.oe_project.oe_project_results + - field.field.node.oe_project.oe_project_website + - field.field.node.oe_project.oe_reference_code + - field.field.node.oe_project.oe_subject + - field.field.node.oe_project.oe_summary + - field.field.node.oe_project.oe_teaser + - node.type.oe_project + module: + - datetime_range + - entity_reference_revisions + - field_group + - link + - rdf_skos + - text + - user +third_party_settings: + field_group: + group_project_details: + children: + - group_website + - group_coordinators + label: 'Project details' + parent_name: '' + region: content + weight: 2 + format_type: html_element + format_settings: + classes: '' + show_empty_fields: false + id: '' + element: div + show_label: false + label_element: h3 + label_element_classes: 'fw-bold mb-4' + attributes: '' + effect: none + speed: fast + group_coordinators: + children: + - oe_project_coordinators + label: Coordinators + parent_name: group_project_details + region: content + weight: 11 + format_type: oe_whitelabel_helper_description_list_pattern + format_settings: { } + group_budget: + children: + - extra_field_oe_whitelabel_extra_project_project_budget + - extra_field_oe_whitelabel_extra_project_eu_contrib + label: Budget + parent_name: '' + region: content + weight: 1 + format_type: html_element + format_settings: + classes: '' + show_empty_fields: false + id: '' + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast + group_website: + children: + - oe_project_website + - oe_project_funding_programme + - oe_reference_code + label: Website + parent_name: group_project_details + region: content + weight: 10 + format_type: oe_whitelabel_helper_description_list_pattern + format_settings: { } +id: node.oe_project.full +targetEntityType: node +bundle: oe_project +mode: full +content: + extra_field_oe_whitelabel_extra_project_eu_contrib: + settings: { } + third_party_settings: { } + weight: 6 + region: content + extra_field_oe_whitelabel_extra_project_project_budget: + settings: { } + third_party_settings: { } + weight: 5 + region: content + oe_cx_achievements_and_milestone: + type: text_default + label: hidden + settings: { } + third_party_settings: { } + weight: 8 + region: content + oe_cx_impacts: + type: text_default + label: hidden + settings: { } + third_party_settings: { } + weight: 5 + region: content + oe_cx_lead_contributors: + type: entity_reference_revisions_entity_view + label: hidden + settings: + view_mode: default + link: '' + third_party_settings: { } + weight: 6 + region: content + oe_cx_objective: + type: text_default + label: hidden + settings: { } + third_party_settings: { } + weight: 4 + region: content + oe_project_coordinators: + type: entity_reference_revisions_label + label: hidden + settings: + link: false + third_party_settings: { } + weight: 4 + region: content + oe_project_dates: + type: daterange_default + label: hidden + settings: + timezone_override: '' + format_type: oe_whitelabel_project_date + separator: '-' + third_party_settings: { } + weight: 0 + region: content + oe_project_funding_programme: + type: skos_concept_entity_reference_label + label: hidden + settings: + link: false + third_party_settings: { } + weight: 4 + region: content + oe_project_participants: + type: entity_reference_revisions_entity_view + label: hidden + settings: + view_mode: default + link: '' + third_party_settings: { } + weight: 7 + region: content + oe_project_website: + type: link + label: hidden + settings: + trim_length: 80 + url_only: false + url_plain: false + rel: '' + target: '' + third_party_settings: { } + weight: 3 + region: content + oe_reference_code: + type: string + label: hidden + settings: + link_to_entity: false + third_party_settings: { } + weight: 6 + region: content + oe_summary: + type: text_default + label: hidden + settings: { } + third_party_settings: { } + weight: 3 + region: content +hidden: + body: true + langcode: true + links: true + oe_content_content_owner: true + oe_content_legacy_link: true + oe_content_navigation_title: true + oe_content_short_title: true + oe_cx_gallery: true + oe_departments: true + oe_documents: true + oe_featured_media: true + oe_project_budget: true + oe_project_budget_eu: true + oe_project_calls: true + oe_project_contact: true + oe_project_eu_budget: true + oe_project_eu_contrib: true + oe_project_locations: true + oe_project_result_files: true + oe_project_results: true + oe_subject: true + oe_teaser: true + search_api_excerpt: true diff --git a/modules/oe_whitelabel_extra_project/config/post_updates/00001_decimal_budget_fields/core.entity_view_display.node.oe_project.oe_w_content_banner.yml b/modules/oe_whitelabel_extra_project/config/post_updates/00001_decimal_budget_fields/core.entity_view_display.node.oe_project.oe_w_content_banner.yml new file mode 100644 index 000000000..107c91138 --- /dev/null +++ b/modules/oe_whitelabel_extra_project/config/post_updates/00001_decimal_budget_fields/core.entity_view_display.node.oe_project.oe_w_content_banner.yml @@ -0,0 +1,92 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.oe_w_content_banner + - field.field.node.oe_project.body + - field.field.node.oe_project.oe_cx_achievements_and_milestone + - field.field.node.oe_project.oe_cx_gallery + - field.field.node.oe_project.oe_cx_impacts + - field.field.node.oe_project.oe_cx_lead_contributors + - field.field.node.oe_project.oe_cx_objective + - field.field.node.oe_project.oe_departments + - field.field.node.oe_project.oe_documents + - field.field.node.oe_project.oe_featured_media + - field.field.node.oe_project.oe_project_budget + - field.field.node.oe_project.oe_project_budget_eu + - field.field.node.oe_project.oe_project_calls + - field.field.node.oe_project.oe_project_contact + - field.field.node.oe_project.oe_project_coordinators + - field.field.node.oe_project.oe_project_dates + - field.field.node.oe_project.oe_project_eu_budget + - field.field.node.oe_project.oe_project_eu_contrib + - field.field.node.oe_project.oe_project_funding_programme + - field.field.node.oe_project.oe_project_locations + - field.field.node.oe_project.oe_project_participants + - field.field.node.oe_project.oe_project_result_files + - field.field.node.oe_project.oe_project_results + - field.field.node.oe_project.oe_project_website + - field.field.node.oe_project.oe_reference_code + - field.field.node.oe_project.oe_subject + - field.field.node.oe_project.oe_summary + - field.field.node.oe_project.oe_teaser + - node.type.oe_project + module: + - rdf_skos + - text + - user +id: node.oe_project.oe_w_content_banner +targetEntityType: node +bundle: oe_project +mode: oe_w_content_banner +content: + oe_subject: + type: skos_concept_entity_reference_label + label: hidden + settings: + link: false + third_party_settings: { } + weight: 1 + region: content + oe_teaser: + type: text_default + label: hidden + settings: { } + third_party_settings: { } + weight: 0 + region: content +hidden: + body: true + extra_field_oe_whitelabel_extra_project_eu_contrib: true + extra_field_oe_whitelabel_extra_project_project_budget: true + langcode: true + links: true + oe_content_content_owner: true + oe_content_legacy_link: true + oe_content_navigation_title: true + oe_content_short_title: true + oe_cx_achievements_and_milestone: true + oe_cx_gallery: true + oe_cx_impacts: true + oe_cx_lead_contributors: true + oe_cx_objective: true + oe_departments: true + oe_documents: true + oe_featured_media: true + oe_project_budget: true + oe_project_budget_eu: true + oe_project_calls: true + oe_project_contact: true + oe_project_coordinators: true + oe_project_dates: true + oe_project_eu_budget: true + oe_project_eu_contrib: true + oe_project_funding_programme: true + oe_project_locations: true + oe_project_participants: true + oe_project_result_files: true + oe_project_results: true + oe_project_website: true + oe_reference_code: true + oe_summary: true + search_api_excerpt: true diff --git a/modules/oe_whitelabel_extra_project/config/post_updates/00001_decimal_budget_fields/core.entity_view_display.node.oe_project.teaser.yml b/modules/oe_whitelabel_extra_project/config/post_updates/00001_decimal_budget_fields/core.entity_view_display.node.oe_project.teaser.yml new file mode 100644 index 000000000..513ec1229 --- /dev/null +++ b/modules/oe_whitelabel_extra_project/config/post_updates/00001_decimal_budget_fields/core.entity_view_display.node.oe_project.teaser.yml @@ -0,0 +1,131 @@ +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.node.teaser + - field.field.node.oe_project.body + - field.field.node.oe_project.oe_cx_achievements_and_milestone + - field.field.node.oe_project.oe_cx_gallery + - field.field.node.oe_project.oe_cx_impacts + - field.field.node.oe_project.oe_cx_lead_contributors + - field.field.node.oe_project.oe_cx_objective + - field.field.node.oe_project.oe_departments + - field.field.node.oe_project.oe_documents + - field.field.node.oe_project.oe_featured_media + - field.field.node.oe_project.oe_project_budget + - field.field.node.oe_project.oe_project_budget_eu + - field.field.node.oe_project.oe_project_calls + - field.field.node.oe_project.oe_project_contact + - field.field.node.oe_project.oe_project_coordinators + - field.field.node.oe_project.oe_project_dates + - field.field.node.oe_project.oe_project_eu_budget + - field.field.node.oe_project.oe_project_eu_contrib + - field.field.node.oe_project.oe_project_funding_programme + - field.field.node.oe_project.oe_project_locations + - field.field.node.oe_project.oe_project_participants + - field.field.node.oe_project.oe_project_result_files + - field.field.node.oe_project.oe_project_results + - field.field.node.oe_project.oe_project_website + - field.field.node.oe_project.oe_reference_code + - field.field.node.oe_project.oe_subject + - field.field.node.oe_project.oe_summary + - field.field.node.oe_project.oe_teaser + - node.type.oe_project + module: + - datetime_range + - field_group + - oe_content_featured_media_field + - rdf_skos + - text + - user +third_party_settings: + field_group: + group_stakeholders: + children: + - oe_project_participants + label: Stakeholders + parent_name: '' + region: hidden + weight: 35 + format_type: html_element + format_settings: + classes: '' + id: '' + element: div + show_label: false + label_element: h3 + label_element_classes: '' + attributes: '' + effect: none + speed: fast +id: node.oe_project.teaser +targetEntityType: node +bundle: oe_project +mode: teaser +content: + oe_featured_media: + type: oe_featured_media_label + label: hidden + settings: + link: true + third_party_settings: { } + weight: 0 + region: content + oe_project_dates: + type: daterange_default + label: hidden + settings: + timezone_override: '' + format_type: oe_whitelabel_project_date + separator: '-' + third_party_settings: { } + weight: 3 + region: content + oe_subject: + type: skos_concept_entity_reference_label + label: hidden + settings: + link: false + third_party_settings: { } + weight: 2 + region: content + oe_teaser: + type: text_default + label: hidden + settings: { } + third_party_settings: { } + weight: 1 + region: content +hidden: + body: true + extra_field_oe_whitelabel_extra_project_eu_contrib: true + extra_field_oe_whitelabel_extra_project_project_budget: true + langcode: true + links: true + oe_content_content_owner: true + oe_content_legacy_link: true + oe_content_navigation_title: true + oe_content_short_title: true + oe_cx_achievements_and_milestone: true + oe_cx_gallery: true + oe_cx_impacts: true + oe_cx_lead_contributors: true + oe_cx_objective: true + oe_departments: true + oe_documents: true + oe_project_budget: true + oe_project_budget_eu: true + oe_project_calls: true + oe_project_contact: true + oe_project_coordinators: true + oe_project_eu_budget: true + oe_project_eu_contrib: true + oe_project_funding_programme: true + oe_project_locations: true + oe_project_participants: true + oe_project_result_files: true + oe_project_results: true + oe_project_website: true + oe_reference_code: true + oe_summary: true + search_api_excerpt: true diff --git a/modules/oe_whitelabel_extra_project/oe_whitelabel_extra_project.info.yml b/modules/oe_whitelabel_extra_project/oe_whitelabel_extra_project.info.yml index ee019b8e8..0b0482b5d 100644 --- a/modules/oe_whitelabel_extra_project/oe_whitelabel_extra_project.info.yml +++ b/modules/oe_whitelabel_extra_project/oe_whitelabel_extra_project.info.yml @@ -4,6 +4,7 @@ description: Module to override content extra project. package: OpenEuropa Whitelabel Theme core_version_requirement: ^9.3 dependencies: + - extra_field:extra_field - oe_content_extra:oe_content_extra_project - oe_whitelabel_helper:oe_whitelabel_helper diff --git a/modules/oe_whitelabel_extra_project/oe_whitelabel_extra_project.module b/modules/oe_whitelabel_extra_project/oe_whitelabel_extra_project.module index 2300a0dcd..0ba9afb00 100644 --- a/modules/oe_whitelabel_extra_project/oe_whitelabel_extra_project.module +++ b/modules/oe_whitelabel_extra_project/oe_whitelabel_extra_project.module @@ -255,8 +255,8 @@ function _oe_whitelabel_extra_project_preprocess_status_and_progress(array &$var */ function _oe_whitelabel_extra_project_preprocess_contributions(array &$variables): void { $field_bg_classes = [ - 'oe_project_budget' => 'bg-gray-400', - 'oe_project_budget_eu' => 'bg-primary', + 'extra_field_oe_whitelabel_extra_project_project_budget' => 'bg-gray-400', + 'extra_field_oe_whitelabel_extra_project_eu_contrib' => 'bg-primary', ]; $legend_items = []; foreach ($field_bg_classes as $field_name => $bg_class) { @@ -295,8 +295,14 @@ function _oe_whitelabel_extra_project_preprocess_contributions(array &$variables /** @var \Drupal\node\NodeInterface $node */ $node = $variables['node']; - $overall_budget = $node->get('oe_project_budget')->value; - $eu_budget = $node->get('oe_project_budget_eu')->value; + $overall_budget = $node->get('oe_project_eu_budget')->value; + if (empty($overall_budget)) { + $overall_budget = $node->get('oe_project_budget')->value; + } + $eu_budget = $node->get('oe_project_eu_contrib')->value; + if (empty($eu_budget)) { + $eu_budget = $node->get('oe_project_budget_eu')->value; + } if ($overall_budget === NULL || $eu_budget === NULL diff --git a/modules/oe_whitelabel_extra_project/oe_whitelabel_extra_project.post_update.php b/modules/oe_whitelabel_extra_project/oe_whitelabel_extra_project.post_update.php new file mode 100644 index 000000000..f9fb6cab4 --- /dev/null +++ b/modules/oe_whitelabel_extra_project/oe_whitelabel_extra_project.post_update.php @@ -0,0 +1,23 @@ +viewBuilder = $entity_type_manager->getViewBuilder('node'); + } + + /** + * {@inheritdoc} + */ + public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { + return new static( + $configuration, + $plugin_id, + $plugin_definition, + $container->get('entity_type.manager') + ); + } + + /** + * {@inheritdoc} + */ + public function viewElements(ContentEntityInterface $entity) { + $field_budget = $this->getLegacyBudgetFieldName(); + $field_eu_budget = $this->getBudgetFieldName(); + + if ($entity->get($field_budget)->isEmpty() && $entity->get($field_eu_budget)->isEmpty()) { + return []; + } + + $build = []; + $display_options = [ + 'label' => 'hidden', + 'type' => 'number_decimal', + 'settings' => [ + 'thousand_separator' => '.', + 'decimal_separator' => ',', + 'scale' => 2, + 'prefix_suffix' => TRUE, + ], + ]; + + $field_name = $entity->get($field_eu_budget)->isEmpty() ? $field_budget : $field_eu_budget; + $build[] = $this->viewBuilder->viewField($entity->get($field_name), $display_options); + + return $build; + } + + /** + * Returns the old budget field name. + * + * @return string + * The budget field. + */ + abstract protected function getLegacyBudgetFieldName(): string; + + /** + * Returns the new budget field name. + * + * @return string + * The budget field. + */ + abstract protected function getBudgetFieldName(): string; + +} diff --git a/modules/oe_whitelabel_extra_project/src/Plugin/ExtraField/Display/EuContributionExtraField.php b/modules/oe_whitelabel_extra_project/src/Plugin/ExtraField/Display/EuContributionExtraField.php new file mode 100644 index 000000000..bac51b83e --- /dev/null +++ b/modules/oe_whitelabel_extra_project/src/Plugin/ExtraField/Display/EuContributionExtraField.php @@ -0,0 +1,42 @@ +t('EU contribution'); + } + + /** + * {@inheritdoc} + */ + protected function getLegacyBudgetFieldName(): string { + return 'oe_project_budget_eu'; + } + + /** + * {@inheritdoc} + */ + protected function getBudgetFieldName(): string { + return 'oe_project_eu_contrib'; + } + +} diff --git a/modules/oe_whitelabel_extra_project/src/Plugin/ExtraField/Display/OverallBudgetExtraField.php b/modules/oe_whitelabel_extra_project/src/Plugin/ExtraField/Display/OverallBudgetExtraField.php new file mode 100644 index 000000000..e22fbae3d --- /dev/null +++ b/modules/oe_whitelabel_extra_project/src/Plugin/ExtraField/Display/OverallBudgetExtraField.php @@ -0,0 +1,42 @@ +t('Overall budget'); + } + + /** + * {@inheritdoc} + */ + protected function getLegacyBudgetFieldName(): string { + return 'oe_project_budget'; + } + + /** + * {@inheritdoc} + */ + protected function getBudgetFieldName(): string { + return 'oe_project_eu_budget'; + } + +} diff --git a/tests/src/Functional/ContentEventRenderTest.php b/tests/src/Functional/ContentEventRenderTest.php index 65d897cb1..2d6c8a3fd 100644 --- a/tests/src/Functional/ContentEventRenderTest.php +++ b/tests/src/Functional/ContentEventRenderTest.php @@ -94,9 +94,10 @@ public function testEventPage(): void { $this->drupalGet('node/' . $node->id()); $crawler = $client->getCrawler(); + /** @var \Symfony\Component\DomCrawler\Crawler $link */ $link = $crawler->filter('.bcl-content-banner a[href="/build/node/' . $node->id() . '"]'); $this->assertCount(1, $link); - $this->assertObjectNotHasAttribute('target', $link); + $this->assertNull($link->attr('target')); $this->assertStringContainsString('Register', $link->text()); $this->assertStringContainsString('calendar-check', $link->html()); diff --git a/tests/src/FunctionalJavascript/ContentProjectRenderTest.php b/tests/src/FunctionalJavascript/ContentProjectRenderTest.php index b34da6e37..27ac2cf84 100644 --- a/tests/src/FunctionalJavascript/ContentProjectRenderTest.php +++ b/tests/src/FunctionalJavascript/ContentProjectRenderTest.php @@ -277,6 +277,26 @@ public function testProjectRendering(): void { $this->assertProjectStatusVisible(); $this->assertProjectStatus('bg-secondary', 'Planned'); $this->assertProjectProgress(0); + + // Assert budget with new fields. + $node->set('oe_project_eu_budget', '104479592'); + $node->set('oe_project_eu_contrib', '7812356'); + $node->save(); + $this->drupalGet($node->toUrl()); + $description_list = $project_content->find('css', '.bcl-description-list'); + + $description_list_assert->assertPattern([ + 'items' => [ + [ + 'term' => 'Overall budget', + 'definition' => '€104.479.592,00', + ], + [ + 'term' => 'EU contribution', + 'definition' => '€7.812.356,00', + ], + ], + ], $description_list->getOuterHtml()); } /** diff --git a/tests/src/Kernel/ContentLanguageSwitcherTest.php b/tests/src/Kernel/ContentLanguageSwitcherTest.php index 797bdaac9..c178122bc 100644 --- a/tests/src/Kernel/ContentLanguageSwitcherTest.php +++ b/tests/src/Kernel/ContentLanguageSwitcherTest.php @@ -6,6 +6,7 @@ use Drupal\node\Entity\Node; use Drupal\KernelTests\KernelTestBase; +use Drupal\user\Entity\User; use Symfony\Component\DomCrawler\Crawler; use Symfony\Component\HttpFoundation\Request; @@ -72,8 +73,9 @@ protected function setUp(): void { // in places like route enhancers. // @see CurrentUserContext::getRuntimeContexts(). // @see EntityConverter::convert(). - module_load_include('install', 'user'); + $this->container->get('module_handler')->loadInclude('oe_multilingual', 'install'); user_install(); + \Drupal::currentUser()->setAccount(User::load(1)); \Drupal::service('kernel')->rebuildContainer(); } diff --git a/tests/src/Kernel/MultilingualBlockTest.php b/tests/src/Kernel/MultilingualBlockTest.php index a87ba42d9..b441d9560 100644 --- a/tests/src/Kernel/MultilingualBlockTest.php +++ b/tests/src/Kernel/MultilingualBlockTest.php @@ -92,76 +92,76 @@ public function testBlockRendering(): void { $button_header = $crawler->filter('button.btn-close'); $this->assertSame('modal', $button_header->attr('data-bs-dismiss')); $link_language = $crawler->filter('a#link_bg'); - $this->assertSame('http://localhost/bg/%3Cnone%3E', $link_language->attr('href')); + $this->assertEmpty($link_language->attr('href')); $this->assertSame('български', $link_language->text()); $link_language = $crawler->filter('a#link_cs'); - $this->assertSame('http://localhost/cs/%3Cnone%3E', $link_language->attr('href')); + $this->assertEmpty($link_language->attr('href')); $this->assertSame('čeština', $link_language->text()); $link_language = $crawler->filter('a#link_da'); - $this->assertSame('http://localhost/da/%3Cnone%3E', $link_language->attr('href')); + $this->assertEmpty($link_language->attr('href')); $this->assertSame('dansk', $link_language->text()); $link_language = $crawler->filter('a#link_de'); - $this->assertSame('http://localhost/de/%3Cnone%3E', $link_language->attr('href')); + $this->assertEmpty($link_language->attr('href')); $this->assertSame('Deutsch', $link_language->text()); $link_language = $crawler->filter('a#link_et'); - $this->assertSame('http://localhost/et/%3Cnone%3E', $link_language->attr('href')); + $this->assertEmpty($link_language->attr('href')); $this->assertSame('eesti', $link_language->text()); $link_language = $crawler->filter('a#link_el'); - $this->assertSame('http://localhost/el/%3Cnone%3E', $link_language->attr('href')); + $this->assertEmpty($link_language->attr('href')); $this->assertSame('ελληνικά', $link_language->text()); $link_language = $crawler->filter('a#link_en'); - $this->assertSame('http://localhost/en/%3Cnone%3E', $link_language->attr('href')); + $this->assertEmpty($link_language->attr('href')); $this->assertSame('English', $link_language->text()); $link_language = $crawler->filter('a#link_es'); - $this->assertSame('http://localhost/es/%3Cnone%3E', $link_language->attr('href')); + $this->assertEmpty($link_language->attr('href')); $this->assertSame('español', $link_language->text()); $link_language = $crawler->filter('a#link_fr'); - $this->assertSame('http://localhost/fr/%3Cnone%3E', $link_language->attr('href')); + $this->assertEmpty($link_language->attr('href')); $this->assertSame('français', $link_language->text()); $link_language = $crawler->filter('a#link_ga'); - $this->assertSame('http://localhost/ga/%3Cnone%3E', $link_language->attr('href')); + $this->assertEmpty($link_language->attr('href')); $this->assertSame('Gaeilge', $link_language->text()); $link_language = $crawler->filter('a#link_hr'); - $this->assertSame('http://localhost/hr/%3Cnone%3E', $link_language->attr('href')); + $this->assertEmpty($link_language->attr('href')); $this->assertSame('hrvatski', $link_language->text()); $link_language = $crawler->filter('a#link_it'); - $this->assertSame('http://localhost/it/%3Cnone%3E', $link_language->attr('href')); + $this->assertEmpty($link_language->attr('href')); $this->assertSame('italiano', $link_language->text()); $link_language = $crawler->filter('a#link_lt'); - $this->assertSame('http://localhost/lt/%3Cnone%3E', $link_language->attr('href')); + $this->assertEmpty($link_language->attr('href')); $this->assertSame('lietuvių', $link_language->text()); $link_language = $crawler->filter('a#link_lv'); - $this->assertSame('http://localhost/lv/%3Cnone%3E', $link_language->attr('href')); + $this->assertEmpty($link_language->attr('href')); $this->assertSame('latviešu', $link_language->text()); $link_language = $crawler->filter('a#link_hu'); - $this->assertSame('http://localhost/hu/%3Cnone%3E', $link_language->attr('href')); + $this->assertEmpty($link_language->attr('href')); $this->assertSame('magyar', $link_language->text()); $link_language = $crawler->filter('a#link_mt'); - $this->assertSame('http://localhost/mt/%3Cnone%3E', $link_language->attr('href')); + $this->assertEmpty($link_language->attr('href')); $this->assertSame('Malti', $link_language->text()); $link_language = $crawler->filter('a#link_nl'); - $this->assertSame('http://localhost/nl/%3Cnone%3E', $link_language->attr('href')); + $this->assertEmpty($link_language->attr('href')); $this->assertSame('Nederlands', $link_language->text()); $link_language = $crawler->filter('a#link_pl'); - $this->assertSame('http://localhost/pl/%3Cnone%3E', $link_language->attr('href')); + $this->assertEmpty($link_language->attr('href')); $this->assertSame('polski', $link_language->text()); $link_language = $crawler->filter('a#link_pt-pt'); - $this->assertSame('http://localhost/pt/%3Cnone%3E', $link_language->attr('href')); + $this->assertEmpty($link_language->attr('href')); $this->assertSame('português', $link_language->text()); $link_language = $crawler->filter('a#link_ro'); - $this->assertSame('http://localhost/ro/%3Cnone%3E', $link_language->attr('href')); + $this->assertEmpty($link_language->attr('href')); $this->assertSame('română', $link_language->text()); $link_language = $crawler->filter('a#link_sk'); - $this->assertSame('http://localhost/sk/%3Cnone%3E', $link_language->attr('href')); + $this->assertEmpty($link_language->attr('href')); $this->assertSame('slovenčina', $link_language->text()); $link_language = $crawler->filter('a#link_sl'); - $this->assertSame('http://localhost/sl/%3Cnone%3E', $link_language->attr('href')); + $this->assertEmpty($link_language->attr('href')); $this->assertSame('slovenščina', $link_language->text()); $link_language = $crawler->filter('a#link_fi'); - $this->assertSame('http://localhost/fi/%3Cnone%3E', $link_language->attr('href')); + $this->assertEmpty($link_language->attr('href')); $this->assertSame('suomi', $link_language->text()); $link_language = $crawler->filter('a#link_sv'); - $this->assertSame('http://localhost/sv/%3Cnone%3E', $link_language->attr('href')); + $this->assertEmpty($link_language->attr('href')); $this->assertSame('svenska', $link_language->text()); }