diff --git a/tests/features/communities/eupl/jlc.feature b/tests/features/communities/eupl/jlc.feature index 19800a2deb..fedf20c135 100644 --- a/tests/features/communities/eupl/jlc.feature +++ b/tests/features/communities/eupl/jlc.feature @@ -65,7 +65,7 @@ Feature: | http://joinup.eu/licence/soft | SOFT | SOFT | For software | Then the following combination of licences should be described in the compatibility document: - | use | redistribute as | document ID | + | inbound | outbound | document ID | | AGPL-3.0-only | AGPL-3.0-only | T01 | | EUPL-1.1 | EUPL-1.1 | T01 | | EUPL-1.2 | EUPL-1.2 | T01 | @@ -249,14 +249,14 @@ Feature: # The compatibility documents should exist and have a default text. When I click "Edit" in the "T01" row Then I should see the heading "Edit T01" - And I should see the text "Compatibility document comparing @use-licence with @redistribute-as-licence." + And I should see the text "Compatibility document comparing @inbound-licence with @outbound-licence." # The document should be editable. - When I fill in "Description" with "In case the two components are not merged, each component keeps its primary licence: @use-licence or @redistribute-as-licence." + When I fill in "Description" with "In case the two components are not merged, each component keeps its primary licence: @inbound-licence or @outbound-licence." And I press "Save" Then I should see the success message "The compatibility document T01 has been updated." When I click "Edit" in the "T01" row - Then I should see the text "In case the two components are not merged, each component keeps its primary licence: @use-licence or @redistribute-as-licence." + Then I should see the text "In case the two components are not merged, each component keeps its primary licence: @inbound-licence or @outbound-licence." # The compatibility documents are populated automatically when visiting the # overview. Clean them up again. @@ -281,40 +281,40 @@ Feature: And compatibility documents: | id | description | | T01 | Freedom for using and re-distributing is a basic common characteristic of all open licences. | - | T10 | The hypothetical risk of 'viral effect' from @redistribute-as-licence to the code covered by @use-licence in the case of dynamic or even static linking will not be validated. | - | T16 | You have to check if the text of @use-licence has expressly mentioned @redistribute-as-licence as compatible. | - | INCOMPATIBLE | @use-licence is not compatible with @redistribute-as-licence. | + | T10 | The hypothetical risk of 'viral effect' from @outbound-licence to the code covered by @inbound-licence in the case of dynamic or even static linking will not be validated. | + | T16 | You have to check if the text of @inbound-licence has expressly mentioned @outbound-licence as compatible. | + | INCOMPATIBLE | @inbound-licence is not compatible with @outbound-licence. | When I go to "licence/compatibility-check/EUPL-1.2/EUPL-1.2" - Then I should see the heading "Can European Union Public Licence 1.2 be redistributed as European Union Public Licence 1.2?" + Then I should see the heading "Compatibility between the European Union Public Licence 1.2 (inbound licence) and the European Union Public Licence 1.2 (outbound licence)." And I should see the text "Freedom for using and re-distributing is a basic common characteristic of all open licences." And the page should be cacheable When I reload the page Then the page should be cached When I visit "licence/compatibility-check/LGPL-2.1/LGPL-2.1" - Then I should see the heading "Can GNU Lesser General Public License 2.1 be redistributed as GNU Lesser General Public License 2.1?" + Then I should see the heading "Compatibility between the GNU Lesser General Public License 2.1 (inbound licence) and the GNU Lesser General Public License 2.1 (outbound licence)." And I should see the text "Freedom for using and re-distributing is a basic common characteristic of all open licences." And the page should be cacheable When I reload the page Then the page should be cached When I visit "licence/compatibility-check/EUPL-1.2/LGPL-2.1" - Then I should see the heading "Can European Union Public Licence 1.2 be redistributed as GNU Lesser General Public License 2.1?" + Then I should see the heading "Compatibility between the European Union Public Licence 1.2 (inbound licence) and the GNU Lesser General Public License 2.1 (outbound licence)." And I should see the text "The hypothetical risk of 'viral effect' from LGPL-2.1 to the code covered by EUPL-1.2 in the case of dynamic or even static linking will not be validated." And the page should be cacheable When I reload the page Then the page should be cached When I visit "licence/compatibility-check/EUPL-1.2/CECILL-C" - Then I should see the heading "Can European Union Public Licence 1.2 be redistributed as CeCILL-C?" + Then I should see the heading "Compatibility between the European Union Public Licence 1.2 (inbound licence) and the CeCILL-C (outbound licence)." And I should see the text "You have to check if the text of EUPL-1.2 has expressly mentioned CECILL-C as compatible." And the page should be cacheable When I reload the page Then the page should be cached When I visit "licence/compatibility-check/LGPL-2.1/CECILL-C" - Then I should see the heading "Can GNU Lesser General Public License 2.1 be redistributed as CeCILL-C?" + Then I should see the heading "Compatibility between the GNU Lesser General Public License 2.1 (inbound licence) and the CeCILL-C (outbound licence)." And I should see the text "LGPL-2.1 is not compatible with CECILL-C" And the page should be cacheable When I reload the page @@ -338,7 +338,7 @@ Feature: # Note that the clicking of the radio buttons is not checked here since this # requires a JS enabled browser. It is tested below. When I go to "licence/compatibility-check/EUPL-1.2/EUPL-1.2" - Then I should see the heading "Can European Union Public Licence 1.2 be redistributed as European Union Public Licence 1.2?" + Then I should see the heading "Compatibility between the European Union Public Licence 1.2 (inbound licence) and the European Union Public Licence 1.2 (outbound licence)." And I should see the text "Freedom for using and re-distributing is a basic common characteristic of all open licences." And the page should be cacheable When I reload the page @@ -363,77 +363,77 @@ Feature: And compatibility documents: | id | description | | T01 | Freedom for using and re-distributing is a basic common characteristic of all open licences. | - | T10 | The hypothetical risk of 'viral effect' from @redistribute-as-licence to the code covered by @use-licence in the case of dynamic or even static linking will not be validated. | - | T16 | You have to check if the text of @use-licence has expressly mentioned @redistribute-as-licence as compatible. | - | INCOMPATIBLE | @use-licence is not compatible with @redistribute-as-licence. | + | T10 | The hypothetical risk of 'viral effect' from @outbound-licence to the code covered by @inbound-licence in the case of dynamic or even static linking will not be validated. | + | T16 | You have to check if the text of @inbound-licence has expressly mentioned @outbound-licence as compatible. | + | INCOMPATIBLE | @inbound-licence is not compatible with @outbound-licence. | When I visit the "JLC" custom page Then the "Check compatibility" buttons should be disabled - When I choose "EUPL-1.2" as the "Use" licence + When I choose "EUPL-1.2" as the "Inbound" licence Then the "Check compatibility" buttons should be disabled - When I choose "EUPL-1.2" as the "Distribute" licence + When I choose "EUPL-1.2" as the "Outbound" licence Then the "Check compatibility" buttons should be enabled # Check that the user can disable the buttons by pressing "Reset" When I press "Reset" Then the "Check compatibility" buttons should be disabled - When I choose "EUPL-1.2" as the "Use" licence - And I choose "EUPL-1.2" as the "Distribute" licence + When I choose "EUPL-1.2" as the "Inbound" licence + And I choose "EUPL-1.2" as the "Outbound" licence And I click "Check compatibility" Then the url should match "licence/compatibility-check/EUPL-1.2/EUPL-1.2" - And I should see the heading "Can European Union Public Licence 1.2 be redistributed as European Union Public Licence 1.2?" + And I should see the heading "Compatibility between the European Union Public Licence 1.2 (inbound licence) and the European Union Public Licence 1.2 (outbound licence)." And I should see the text "Freedom for using and re-distributing is a basic common characteristic of all open licences." When I visit the "JLC" custom page Then the "Check compatibility" buttons should be disabled - When I choose "LGPL-2.1" as the "Use" licence + When I choose "LGPL-2.1" as the "Inbound" licence Then the "Check compatibility" buttons should be disabled - When I choose "LGPL-2.1" as the "Distribute" licence + When I choose "LGPL-2.1" as the "Outbound" licence Then the "Check compatibility" buttons should be enabled When I click "Check compatibility" Then the url should match "licence/compatibility-check/LGPL-2.1/LGPL-2.1" - And I should see the heading "Can GNU Lesser General Public License 2.1 be redistributed as GNU Lesser General Public License 2.1?" + And I should see the heading "Compatibility between the GNU Lesser General Public License 2.1 (inbound licence) and the GNU Lesser General Public License 2.1 (outbound licence)." And I should see the text "Freedom for using and re-distributing is a basic common characteristic of all open licences." When I visit the "JLC" custom page Then the "Check compatibility" buttons should be disabled - When I choose "EUPL-1.2" as the "Use" licence + When I choose "EUPL-1.2" as the "Inbound" licence Then the "Check compatibility" buttons should be disabled - When I choose "LGPL-2.1" as the "Distribute" licence + When I choose "LGPL-2.1" as the "Outbound" licence Then the "Check compatibility" buttons should be enabled When I click "Check compatibility" Then the url should match "licence/compatibility-check/EUPL-1.2/LGPL-2.1" - And I should see the heading "Can European Union Public Licence 1.2 be redistributed as GNU Lesser General Public License 2.1?" + And I should see the heading "Compatibility between the European Union Public Licence 1.2 (inbound licence) and the GNU Lesser General Public License 2.1 (outbound licence)." And I should see the text "The hypothetical risk of 'viral effect' from LGPL-2.1 to the code covered by EUPL-1.2 in the case of dynamic or even static linking will not be validated." When I visit the "JLC" custom page Then the "Check compatibility" buttons should be disabled - When I choose "EUPL-1.2" as the "Use" licence + When I choose "EUPL-1.2" as the "Inbound" licence Then the "Check compatibility" buttons should be disabled - When I choose "CECILL-C" as the "Distribute" licence + When I choose "CECILL-C" as the "Outbound" licence Then the "Check compatibility" buttons should be enabled When I click "Check compatibility" Then the url should match "licence/compatibility-check/EUPL-1.2/CECILL-C" - And I should see the heading "Can European Union Public Licence 1.2 be redistributed as CeCILL-C?" + And I should see the heading "Compatibility between the European Union Public Licence 1.2 (inbound licence) and the CeCILL-C (outbound licence)." And I should see the text "You have to check if the text of EUPL-1.2 has expressly mentioned CECILL-C as compatible." When I visit the "JLC" custom page Then the "Check compatibility" buttons should be disabled - When I choose "LGPL-2.1" as the "Use" licence + When I choose "LGPL-2.1" as the "Inbound" licence Then the "Check compatibility" buttons should be disabled - When I choose "CECILL-C" as the "Distribute" licence + When I choose "CECILL-C" as the "Outbound" licence Then the "Check compatibility" buttons should be enabled When I click "Check compatibility" Then the url should match "licence/compatibility-check/LGPL-2.1/CECILL-C" - And I should see the heading "Can GNU Lesser General Public License 2.1 be redistributed as CeCILL-C?" + And I should see the heading "Compatibility between the GNU Lesser General Public License 2.1 (inbound licence) and the CeCILL-C (outbound licence)." And I should see the text "LGPL-2.1 is not compatible with CECILL-C" When I visit the "JLC" custom page - When I choose "LGPL-2.1" as the "Use" licence - When I choose "CECILL-C" as the "Distribute" licence + When I choose "LGPL-2.1" as the "Inbound" licence + When I choose "CECILL-C" as the "Outbound" licence When I click "Check compatibility" Then the url should match "licence/compatibility-check/LGPL-2.1/CECILL-C" - And I should see the heading "Can GNU Lesser General Public License 2.1 be redistributed as CeCILL-C?" + And I should see the heading "Compatibility between the GNU Lesser General Public License 2.1 (inbound licence) and the CeCILL-C (outbound licence)." And I should see the text "LGPL-2.1 is not compatible with CECILL-C" # Even though moderators can edit compatibility documents they should not be @@ -449,15 +449,15 @@ Feature: Given I am logged in as an "authenticated user" When I visit the "JLC" custom page Then the "Check compatibility" buttons should be disabled - When I choose "EUPL-1.2" as the "Use" licence + When I choose "EUPL-1.2" as the "Inbound" licence Then the "Check compatibility" buttons should be disabled - When I choose "EUPL-1.2" as the "Distribute" licence + When I choose "EUPL-1.2" as the "Outbound" licence Then the "Check compatibility" buttons should be enabled When I press "Reset" Then the "Check compatibility" buttons should be disabled - When I choose "EUPL-1.2" as the "Use" licence - And I choose "EUPL-1.2" as the "Distribute" licence + When I choose "EUPL-1.2" as the "Inbound" licence + And I choose "EUPL-1.2" as the "Outbound" licence And I click "Check compatibility" Then the url should match "licence/compatibility-check/EUPL-1.2/EUPL-1.2" - And I should see the heading "Can European Union Public Licence 1.2 be redistributed as European Union Public Licence 1.2?" + And I should see the heading "Compatibility between the European Union Public Licence 1.2 (inbound licence) and the European Union Public Licence 1.2 (outbound licence)." And I should see the text "Freedom for using and re-distributing is a basic common characteristic of all open licences." diff --git a/tests/src/Context/EuplContext.php b/tests/src/Context/EuplContext.php index 5104864f30..bf2bff38f8 100644 --- a/tests/src/Context/EuplContext.php +++ b/tests/src/Context/EuplContext.php @@ -236,7 +236,7 @@ protected function toggleLicenceForComparison(bool $compare, string $spdx_id): v * @When I choose :spdx_id as the :label licence */ public function selectRadioButtonForLicenceCompatibilityCheck(string $spdx_id, string $label): void { - assert(in_array($label, ['Use', 'Distribute']), 'The purpose should be either "Use" or "Distribute".'); + assert(in_array($label, ['Inbound', 'Outbound']), 'The purpose should be either "Use" or "Distribute".'); $licence = $this->findLicenceTile($spdx_id); $this->selectMaterialDesignRadioButton($label, $licence); } @@ -350,14 +350,14 @@ public function assertLicenceCompatibility(TableNode $table) { /** @var \Drupal\joinup_licence\JoinupLicenceCompatibilityRulePluginManager $plugin_manager */ $plugin_manager = \Drupal::service('plugin.manager.joinup_licence_compatibility_rule'); foreach ($table->getColumnsHash() as $test_case) { - $use_label = $test_case['use']; - $redistribute_as_label = $test_case['redistribute as']; + $use_label = $test_case['inbound']; + $redistribute_as_label = $test_case['outbound']; $expected_result = $test_case['document ID']; - $use_licence = static::loadLicenceByLabel($use_label); - $redistribute_as_licence = static::loadLicenceByLabel($redistribute_as_label); + $inbound_licence = static::loadLicenceByLabel($use_label); + $outbound_licence = static::loadLicenceByLabel($redistribute_as_label); - $result = $plugin_manager->getCompatibilityDocumentId($use_licence, $redistribute_as_licence); + $result = $plugin_manager->getCompatibilityDocumentId($inbound_licence, $outbound_licence); // Check that the returned document ID matches the expected ID. if ($expected_result !== $result) { diff --git a/web/modules/custom/joinup_core/joinup_core.install b/web/modules/custom/joinup_core/joinup_core.install index c1d8af610d..8d99c8b507 100644 --- a/web/modules/custom/joinup_core/joinup_core.install +++ b/web/modules/custom/joinup_core/joinup_core.install @@ -6,194 +6,3 @@ */ declare(strict_types = 1); - -use Drupal\Core\Database\Database; -use Drupal\Core\Entity\EntityStorageInterface; -use Drupal\Core\Site\Settings; -use Drupal\collection\Entity\CollectionInterface; -use Drupal\joinup_community_content\CommunityContentHelper; -use Drupal\solution\Entity\SolutionInterface; -use Drupal\user\Entity\User; - -/** - * Implements hook_requirements(). - * - * Adds some additional security related warnings to the status report: - * - UID1 should be blocked. - * - Config Read Only should be enabled. - */ -function joinup_core_requirements($phase): array { - $requirements = []; - - if ($phase === 'runtime') { - // Check if UID 1 is blocked. Not allowing to log in as the root user - // greatly decreases the chances of a privilege escalation bug to do real - // damage on production. - /** @var \Drupal\user\UserInterface $uid1 */ - $uid1 = User::load(1); - if ($uid1->isActive()) { - $requirements['joinup_core_root_user_blocked'] = [ - 'title' => t('Root user access'), - 'description' => t('Allowing to log in as the root user on production is a security risk.'), - 'severity' => REQUIREMENT_ERROR, - 'value' => t('Root user is not blocked'), - ]; - } - - // Check that the Config Read Only module is enabled and activated. This - // module ensures that the site configuration is immutable. This greatly - // enhances the security of the production environment, and ensures that no - // changes are made on production which can be overwritten on a subsequent - // update. - /** @var \Drupal\Core\Extension\ModuleHandlerInterface $module_handler */ - $module_handler = \Drupal::service('module_handler'); - if (!$module_handler->moduleExists('config_readonly') || !Settings::get('config_readonly')) { - $requirements['joinup_core_config_readonly'] = [ - 'title' => t('Config Read Only'), - 'description' => t('On production environments the site configuration should be read-only.'), - 'severity' => REQUIREMENT_ERROR, - 'value' => t('Config is writable'), - ]; - - // Check that database logging is disabled on production. Writing log - // entries to the database on every request puts unnecessary load on the - // database server. - if ($module_handler->moduleExists('dblog')) { - $requirements['joinup_core_dblog'] = [ - 'title' => t('Database logging'), - 'description' => t('On production environments logs should be written to a file, not to the database.'), - 'severity' => REQUIREMENT_ERROR, - 'value' => t('Database logging is enabled'), - ]; - } - } - - $requirements_helper = \Drupal::getContainer()->get('joinup_core.requirements_helper'); - - // Ensure that a cache state inconsistency will not cause also - // inconsistencies with the published revisions of the entities. - // - // @see: \joinup_core_post_update_set_news_default_version - // @see: \Drupal\joinup_core\RequirementsHelper::getNodesWithProblematicRevisions - // @see: ISAICP-5191 - $requirements['joinup_core_forward_revisions'] = [ - 'title' => t('Forward published revisions'), - 'description' => t('In all content, the last published revision should be the latest of the published revisions.'), - 'severity' => REQUIREMENT_OK, - 'value' => t('No entities were found without a parent.'), - ]; - - $results = $requirements_helper->getNodesWithProblematicRevisions(); - if (!empty($results)) { - $nids = array_keys($results); - $error = t('Issues with the latest revision have been found in the following nid(s): :nids', [ - ':nids' => implode(', ', $nids), - ]); - $requirements['joinup_core_forward_revisions']['severity'] = REQUIREMENT_ERROR; - $requirements['joinup_core_forward_revisions']['value'] = $error; - } - } - - return $requirements; -} - -/** - * Migrate data about pinned entities into meta entities (stage 1). - */ -function joinup_core_update_0106500(): void { - $entity_type_manager = \Drupal::entityTypeManager(); - - $get_storage = function (string $entity_type_id) use ($entity_type_manager): EntityStorageInterface { - return $entity_type_manager->getStorage($entity_type_id); - }; - - $entity_ids = []; - - // Retrieve community content to migrate. - $entity_ids['node'] = array_values($get_storage('node') - ->getQuery() - ->condition('type', CommunityContentHelper::BUNDLES, 'IN') - ->condition('sticky', TRUE) - ->execute()); - - // Retrieve solutions to migrate. - $entity_ids['rdf_entity'] = array_values($get_storage('rdf_entity') - ->getQuery() - ->condition('rid', 'solution') - ->exists('field_is_pinned_in') - ->execute()); - - $solutions = []; - $get_pinned_groups = function (SolutionInterface $solution): array { - return array_map( - function (CollectionInterface $collection) { - return $collection->id(); - }, - $solution->get('field_is_pinned_in')->referencedEntities() - ); - }; - /** @var \Drupal\solution\Entity\SolutionInterface $solution */ - foreach ($get_storage('rdf_entity')->loadMultiple($entity_ids['rdf_entity']) as $solution) { - if ($pinned_groups = $get_pinned_groups($solution)) { - $solutions[$solution->id()] = $pinned_groups; - } - } - - // Save data to be restored in a post-update script. - // @see joinup_core_post_update_0106503() - \Drupal::state()->set('joinup_core_update_0106501', [ - 'entity_ids' => $entity_ids, - 'solutions' => $solutions, - ]); - - // During config import, the Search API indexes are loaded when creating the - // `block.block.eifrecomendationsselector` and `block.block.category` configs - // but the field `field_is_pinned_in` is not yet removed from the Search API - // indexes. This causes an error, as Search API tries to load the field - // definition but the field has been removed already during the config import. - // Explicitly remove the field from indexes in this phase to prevent errors. - foreach (['published', 'unpublished'] as $index_id) { - \Drupal::configFactory()->getEditable("search_api.index.{$index_id}") - ->clear('field_settings.field_is_pinned_in') - ->save(TRUE); - } -} - -/** - * Change the 'only_facilitators' option to 'facilitators_and_authors'. - */ -function joinup_core_update_0106501(): void { - $connection = \Drupal::getContainer()->get('sparql.endpoint'); - $query = <<<QUERY -SELECT ?entity -WHERE { - ?entity ?content_creation_predicate "only_facilitators" . - VALUES ?content_creation_predicate { <http://joinup.eu/solution/content_creation> <http://joinup.eu/solution/content_creation> } -} -QUERY; - - $results = $connection->query($query)->getArrayCopy(); - $results = array_map(function (stdClass $result): string { - return $result->entity->getUri(); - }, $results); - - $update_query = <<<QUERY -DELETE { GRAPH ?g { ?entity ?content_creation_predicate "only_facilitators" } } -INSERT { GRAPH ?g { ?entity ?content_creation_predicate "facilitators_and_authors" } } -WHERE { GRAPH ?g { ?entity ?content_creation_predicate "only_facilitators" } } -QUERY; - $connection->query($update_query); - \Drupal::entityTypeManager()->getStorage('rdf_entity')->resetCache($results); -} - -/** - * Create the table for the new Compatibility Document entity type. - */ -function joinup_core_update_0106502(): void { - if (!Database::getConnection()->schema()->tableExists('compatibility_document')) { - $entity_type_manager = \Drupal::entityTypeManager(); - $entity_type_manager->clearCachedDefinitions(); - $definition = $entity_type_manager->getDefinition('compatibility_document'); - \Drupal::entityDefinitionUpdateManager()->installEntityType($definition); - } -} diff --git a/web/modules/custom/joinup_core/joinup_core.post_update.php b/web/modules/custom/joinup_core/joinup_core.post_update.php index 2b7fd4da67..49751978fd 100644 --- a/web/modules/custom/joinup_core/joinup_core.post_update.php +++ b/web/modules/custom/joinup_core/joinup_core.post_update.php @@ -6,255 +6,3 @@ */ declare(strict_types = 1); - -use Drupal\joinup_community_content\Entity\CommunityContentInterface; -use Drupal\joinup_group\Entity\PinnableGroupContentInterface; - -/** - * Delete all persistent aliases to ensure that they will be rebuilt. - */ -function joinup_core_post_update_0106500(): void { - \Drupal::keyValue('pathauto_state.rdf_entity')->deleteAll(); - \Drupal::keyValue('pathauto_state.node')->deleteAll(); -} - -/** - * Remove path alias duplicates. - */ -function joinup_core_post_update_0106501(?array &$sandbox = NULL): string { - $db = \Drupal::database(); - if (!isset($sandbox['duplicate_pids'])) { - // Get all duplicate path alias IDs. - $sandbox['duplicate_pids'] = $db->query("SELECT p.id - FROM {path_alias} p - LEFT JOIN ( - -- This sub-query returns all alias duplicates of English aliases. - SELECT - MAX(id) AS valid_id, - COUNT(*) AS duplicates_count, - path - FROM {path_alias} - WHERE langcode = 'en' - GROUP BY path - ) valid_aliases ON p.path = valid_aliases.path - WHERE valid_aliases.duplicates_count > 1 - AND valid_aliases.valid_id IS NOT NULL - AND p.id <> valid_aliases.valid_id - -- Only select English aliases. - AND p.langcode = 'en'")->fetchCol(); - $sandbox['progress'] = 0; - $sandbox['total'] = count($sandbox['duplicate_pids']); - } - - if ($to_delete = array_splice($sandbox['duplicate_pids'], 0, 1000)) { - $db->delete('path_alias_revision') - ->condition('id', $to_delete, 'IN') - ->execute(); - $db->delete('path_alias') - ->condition('id', $to_delete, 'IN') - ->execute(); - } - $sandbox['progress'] += count($to_delete); - - if ($sandbox['#finished'] = (int) empty($sandbox['duplicate_pids'])) { - \Drupal::entityTypeManager()->getStorage('path_alias')->resetCache(); - } - - return "Removed {$sandbox['progress']}/{$sandbox['total']}"; -} - -/** - * Update aliases for entities with the old alias. - */ -function joinup_core_post_update_0106502(?array &$sandbox = NULL): string { - $rdf_storage = \Drupal::entityTypeManager()->getStorage('rdf_entity'); - $node_storage = \Drupal::entityTypeManager()->getStorage('node'); - if (empty($sandbox['entity_ids'])) { - // We process first the collections, solutions and releases because they're - // parents for the rest of entities and their alias is used in children - // alias computing. - $sandbox['entity_ids']['rdf_entity'] = $rdf_storage->getQuery()->condition('rid', 'collection')->execute(); - $sandbox['entity_ids']['rdf_entity'] += $rdf_storage->getQuery()->condition('rid', 'solution')->execute(); - $sandbox['entity_ids']['rdf_entity'] += $rdf_storage->getQuery()->condition('rid', 'asset_release')->execute(); - $sandbox['entity_ids']['rdf_entity'] += $rdf_storage->getQuery()->condition('rid', [ - 'collection', - 'solution', - 'asset_release', - ], 'NOT IN')->execute(); - $sandbox['entity_ids']['node'] = $node_storage->getQuery()->execute(); - $sandbox['count'] = 0; - $sandbox['max'] = count($sandbox['entity_ids']['rdf_entity']) + count($sandbox['entity_ids']['node']); - } - - if (empty($sandbox['entity_ids']['rdf_entity'])) { - $storage = $node_storage; - $entity_ids = array_splice($sandbox['entity_ids']['node'], 0, 100); - } - else { - $storage = $rdf_storage; - $entity_ids = array_splice($sandbox['entity_ids']['rdf_entity'], 0, 100); - } - - $alias_generator = \Drupal::getContainer()->get('pathauto.generator'); - foreach ($storage->loadMultiple($entity_ids) as $entity) { - if ($entity->bundle() === 'asset_release' && $entity->field_isr_release_number->isEmpty()) { - // There are a number of releases that do not have a release number, even - // though it is a mandatory field. Aliases fail to be created for these - // entities. These will be handled in ISAICP-6217. - // @see https://citnet.tech.ec.europa.eu/CITnet/jira/browse/ISAICP-6217 - continue; - } - $alias_generator->updateEntityAlias($entity, 'bulkupdate'); - } - - $sandbox['count'] += count($entity_ids); - $sandbox['#finished'] = (int) (empty($sandbox['entity_ids']['rdf_entity']) && empty($sandbox['entity_ids']['node'])); - return "Processed {$sandbox['count']}/{$sandbox['max']}"; -} - -/** - * Migrate data about pinned entities into meta entities (stage 2). - */ -function joinup_core_post_update_0106503(): void { - $state = \Drupal::state(); - $data = $state->get('joinup_core_update_0106501'); - $state->delete('joinup_core_update_0106501'); - - foreach ($data['entity_ids'] as $entity_type_id => $ids) { - $storage = \Drupal::entityTypeManager()->getStorage($entity_type_id); - foreach ($storage->loadMultiple($ids) as $entity) { - if ($entity instanceof PinnableGroupContentInterface) { - if ($entity instanceof CommunityContentInterface) { - $entity->pin(); - } - elseif (!empty($data['solutions'][$entity->id()])) { - foreach ($storage->loadMultiple($data['solutions'][$entity->id()]) as $pinned_group) { - /** @var \Drupal\joinup_group\Entity\GroupInterface $pinned_group */ - $entity->pin($pinned_group); - } - } - // Commit to Solr backend the items tracked to be indexed. - \Drupal::service('search_api.post_request_indexing')->destruct(); - } - } - } - - // Remove stale triples. - $sparql = \Drupal::getContainer()->get('sparql.endpoint'); - foreach (['published', 'draft'] as $status) { - $sparql->query("WITH <http://joinup.eu/solution/{$status}> - DELETE { ?s <http://joinup.eu/solution/pinned_in> ?o } - WHERE { ?s <http://joinup.eu/solution/pinned_in> ?o }"); - } -} - -/** - * Fix the creation date for the RDF graphs. - */ -function joinup_core_post_update_0106504(): void { - $query = <<<QUERY -WITH <http://joinup.eu/bundle/rdf-graph/graph> -INSERT { ?entity <http://purl.org/dc/terms/issued> ?creation_time } -WHERE { - ?entity <http://purl.org/dc/terms/modified> ?creation_time . - FILTER NOT EXISTS { ?entity <http://purl.org/dc/terms/issued> ?time } -} -QUERY; - - \Drupal::getContainer()->get('sparql.endpoint')->query($query); -} - -/** - * Add creation time to entities solutions that lack it. - */ -function joinup_core_post_update_0106505(array &$sandbox): void { - // Query the solutions without created date and their provenance records - // corresponding created date. - $query = <<<QUERY -SELECT DISTINCT ?graph ?id ?created -WHERE { - GRAPH ?graph { - ?id ?p ?o . - ?id a <http://www.w3.org/ns/dcat#Dataset> - FILTER NOT EXISTS {?id <http://purl.org/dc/terms/issued> ?created__value} . - FILTER NOT EXISTS {?id <http://purl.org/dc/terms/isVersionOf> ?field_isr_is_version_of__target_id} - } - ?provenance_id a <http://www.w3.org/ns/prov#Activity> . - ?provenance_id <http://purl.org/dc/terms/issued> ?created . - ?provenance_id <http://www.w3.org/ns/prov#generated> ?id -} -QUERY; - - $database = \Drupal::getContainer()->get('sparql.endpoint'); - $results = $database->query($query); - $ids_to_clear = []; - - foreach ($results as $result) { - $graph = $result->graph->getUri(); - $id = $result->id->getUri(); - $ids_to_clear[] = $id; - $created = $result->created->toRdfPhp(); - $value = $created['value']; - $type = $created['datatype']; - - $insert_query = <<<QUERY -WITH <{$graph}> -INSERT { <$id> <http://purl.org/dc/terms/issued> "{$value}"^^<{$type}> } -QUERY; - $database->query($insert_query); - } - - \Drupal::entityTypeManager()->getStorage('rdf_entity')->resetCache($ids_to_clear); -} - -/** - * Clean up orphaned triples. - */ -function joinup_core_post_update_0106506(): void { - $graphs = [ - 'http://joinup.eu/asset_distribution/published', - 'http://joinup.eu/asset_release/published', - 'http://joinup.eu/asset_release/draft', - 'http://joinup.eu/collection/published', - 'http://joinup.eu/collection/draft', - 'http://joinup.eu/contact-information/published', - 'http://joinup.eu/licence/published', - 'http://joinup.eu/owner/published', - 'http://joinup.eu/provenance_activity', - 'http://joinup.eu/solution/published', - 'http://joinup.eu/solution/draft', - 'http://joinup.eu/spdx_licence/published', - ]; - $connection = \Drupal::getContainer()->get('sparql.endpoint'); - foreach ($graphs as $graph) { - $query = <<<QUERY -WITH <{$graph}> -DELETE { ?s ?p ?o } -WHERE { - ?s ?p ?o . - FILTER NOT EXISTS {?s <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?type} . -} -QUERY; - $connection->query($query); - } -} - -/** - * Clean up the validation graphs. - */ -function joinup_core_post_update_0106507(array &$sandbox): void { - $query = <<<QUERY -SELECT DISTINCT ?g - WHERE { GRAPH ?g {?s ?p ?o} } -ORDER BY ?g -QUERY; - - $connection = \Drupal::getContainer()->get('sparql.endpoint'); - $graphs = $connection->query($query); - foreach ($graphs as $graph) { - $uri = $graph->g->getUri(); - if (strpos($uri, 'http://adms-validator/') === 0) { - $connection->query("CLEAR GRAPH <$uri>"); - } - } -} diff --git a/web/modules/custom/joinup_licence/joinup_licence.routing.yml b/web/modules/custom/joinup_licence/joinup_licence.routing.yml index b51a640352..399122cdb4 100644 --- a/web/modules/custom/joinup_licence/joinup_licence.routing.yml +++ b/web/modules/custom/joinup_licence/joinup_licence.routing.yml @@ -30,7 +30,7 @@ joinup_licence.comparer: type: spdx_ids_list joinup_licence.compatibility_check: - path: '/licence/compatibility-check/{use_licence}/{redistribute_as_licence}' + path: '/licence/compatibility-check/{inbound_licence}/{outbound_licence}' defaults: _controller: 'Drupal\joinup_licence\Controller\LicenceCompatibilityController::check' _title_callback: 'Drupal\joinup_licence\Controller\LicenceCompatibilityController::getTitle' @@ -38,9 +38,9 @@ joinup_licence.compatibility_check: _permission: 'view compatibility documents' options: parameters: - use_licence: + inbound_licence: type: licence_spdx_id - redistribute_as_licence: + outbound_licence: type: licence_spdx_id entity.compatibility_document.collection: diff --git a/web/modules/custom/joinup_licence/js/licence_filter.js b/web/modules/custom/joinup_licence/js/licence_filter.js index 7e54007a9f..1fb1008e3a 100644 --- a/web/modules/custom/joinup_licence/js/licence_filter.js +++ b/web/modules/custom/joinup_licence/js/licence_filter.js @@ -220,11 +220,11 @@ // Change compatible elements if the radio is clicked. $(this).on('click', function () { - var use_licence = $("input[name='use-licence']:checked").attr('data-licence-name'); - var distribute_licence = $("input[name='distribute-as-licence']:checked").attr('data-licence-name'); + var inbound_licence = $("input[name='inbound-licence']:checked").attr('data-licence-name'); + var distribute_licence = $("input[name='outbound-licence']:checked").attr('data-licence-name'); - if(use_licence && distribute_licence) { - var compatible_url = drupalSettings.path.baseUrl + "licence/compatibility-check/" + use_licence + "/" + distribute_licence; + if(inbound_licence && distribute_licence) { + var compatible_url = drupalSettings.path.baseUrl + "licence/compatibility-check/" + inbound_licence + "/" + distribute_licence; $('.licence-tile__button--compatible').attr('href', compatible_url); enableButtons(true); } diff --git a/web/modules/custom/joinup_licence/src/Controller/LicenceCompatibilityController.php b/web/modules/custom/joinup_licence/src/Controller/LicenceCompatibilityController.php index 3bf5b951e9..dc65c08074 100644 --- a/web/modules/custom/joinup_licence/src/Controller/LicenceCompatibilityController.php +++ b/web/modules/custom/joinup_licence/src/Controller/LicenceCompatibilityController.php @@ -17,18 +17,18 @@ class LicenceCompatibilityController extends ControllerBase { /** * Renders a page that contains a licence compatibility check. * - * @param \Drupal\joinup_licence\Entity\LicenceInterface $use_licence + * @param \Drupal\joinup_licence\Entity\LicenceInterface $inbound_licence * The licence used for code or data that is intended to be redistributed as * part of another project. - * @param \Drupal\joinup_licence\Entity\LicenceInterface $redistribute_as_licence + * @param \Drupal\joinup_licence\Entity\LicenceInterface $outbound_licence * The licence under which the code or data is intended to be redistributed. * * @return array * A render array. */ - public function check(LicenceInterface $use_licence, LicenceInterface $redistribute_as_licence): array { + public function check(LicenceInterface $inbound_licence, LicenceInterface $outbound_licence): array { try { - $compatibility_document = $use_licence->getCompatibilityDocument($redistribute_as_licence); + $compatibility_document = $inbound_licence->getCompatibilityDocument($outbound_licence); } catch (\Exception $e) { throw new NotFoundHttpException(); @@ -43,8 +43,8 @@ public function check(LicenceInterface $use_licence, LicenceInterface $redistrib $cache_metadata = new CacheableMetadata(); $cache_metadata ->addCacheableDependency($compatibility_document) - ->addCacheableDependency($use_licence) - ->addCacheableDependency($redistribute_as_licence) + ->addCacheableDependency($inbound_licence) + ->addCacheableDependency($outbound_licence) ->applyTo($build); return $build; @@ -53,20 +53,20 @@ public function check(LicenceInterface $use_licence, LicenceInterface $redistrib /** * Title callback. * - * @param \Drupal\joinup_licence\Entity\LicenceInterface $use_licence + * @param \Drupal\joinup_licence\Entity\LicenceInterface $inbound_licence * The licence used for code or data that is intended to be redistributed as * part of another project. - * @param \Drupal\joinup_licence\Entity\LicenceInterface $redistribute_as_licence + * @param \Drupal\joinup_licence\Entity\LicenceInterface $outbound_licence * The licence under which the code or data is intended to be redistributed. * * @return array * The title as a render array. */ - public function getTitle(LicenceInterface $use_licence, LicenceInterface $redistribute_as_licence): array { + public function getTitle(LicenceInterface $inbound_licence, LicenceInterface $outbound_licence): array { return [ - '#markup' => $this->t('Can %use_licence be redistributed as %redistribute_as_licence?', [ - '%use_licence' => $use_licence->label(), - '%redistribute_as_licence' => $redistribute_as_licence->label(), + '#markup' => $this->t('Compatibility between the %inbound (inbound licence) and the %outbound (outbound licence).', [ + '%inbound' => $inbound_licence->label(), + '%outbound' => $outbound_licence->label(), ]), ]; } diff --git a/web/modules/custom/joinup_licence/src/Entity/CompatibilityDocument.php b/web/modules/custom/joinup_licence/src/Entity/CompatibilityDocument.php index 8c899b01b7..3afab7dd9f 100644 --- a/web/modules/custom/joinup_licence/src/Entity/CompatibilityDocument.php +++ b/web/modules/custom/joinup_licence/src/Entity/CompatibilityDocument.php @@ -92,13 +92,13 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type): a ]) ->setDisplayConfigurable('view', TRUE); - $fields['use_licence'] = BaseFieldDefinition::create('entity_reference') + $fields['inbound_licence'] = BaseFieldDefinition::create('entity_reference') ->setLabel(t('Use licence')) ->setDescription(t('The licence of the project that is being used as part of a new project.')) ->setComputed(TRUE) ->setClass(CompatibilityDocumentLicenceFieldItemList::class); - $fields['redistribute_as_licence'] = BaseFieldDefinition::create('entity_reference') + $fields['outbound_licence'] = BaseFieldDefinition::create('entity_reference') ->setLabel(t('Redistribute as licence')) ->setDescription(t('The licence under which the new project will be distributed.')) ->setComputed(TRUE) @@ -145,7 +145,7 @@ public static function populate(): void { foreach ($missing_entity_ids as $entity_id) { $storage->create([ 'id' => $entity_id, - 'description' => 'Compatibility document comparing @use-licence with @redistribute-as-licence.', + 'description' => 'Compatibility document comparing @inbound-licence with @outbound-licence.', ])->save(); } @@ -160,7 +160,7 @@ public static function populate(): void { * {@inheritdoc} */ public function setUseLicence(LicenceInterface $licence): CompatibilityDocumentInterface { - $this->set('use_licence', $licence); + $this->set('inbound_licence', $licence); return $this; } @@ -168,7 +168,7 @@ public function setUseLicence(LicenceInterface $licence): CompatibilityDocumentI * {@inheritdoc} */ public function setRedistributeAsLicence(LicenceInterface $licence): CompatibilityDocumentInterface { - $this->set('redistribute_as_licence', $licence); + $this->set('outbound_licence', $licence); return $this; } @@ -176,14 +176,14 @@ public function setRedistributeAsLicence(LicenceInterface $licence): Compatibili * {@inheritdoc} */ public function getUseLicence(): ?LicenceInterface { - return $this->getLicence('use_licence'); + return $this->getLicence('inbound_licence'); } /** * {@inheritdoc} */ public function getRedistributeAsLicence(): ?LicenceInterface { - return $this->getLicence('redistribute_as_licence'); + return $this->getLicence('outbound_licence'); } /** @@ -208,14 +208,14 @@ protected function getLicence(string $field_name): ?LicenceInterface { */ public function getDescription(): FormattableMarkup { $description = $this->getMainPropertyValue('description') ?? ''; - $use_licence = $this->getUseLicence(); - $use_licence_id = $use_licence ? $use_licence->getSpdxLicenceId() ?? $this->t('Unknown') : $this->t('Unknown'); - $redistribute_as_licence = $this->getRedistributeAsLicence(); - $redistribute_as_licence_id = $redistribute_as_licence ? $redistribute_as_licence->getSpdxLicenceId() ?? $this->t('Unknown') : $this->t('Unknown'); + $inbound_licence = $this->getUseLicence(); + $inbound_licence_id = $inbound_licence ? $inbound_licence->getSpdxLicenceId() ?? $this->t('Unknown') : $this->t('Unknown'); + $outbound_licence = $this->getRedistributeAsLicence(); + $outbound_licence_id = $outbound_licence ? $outbound_licence->getSpdxLicenceId() ?? $this->t('Unknown') : $this->t('Unknown'); return new FormattableMarkup($description, [ - '@use-licence' => $use_licence_id, - '@redistribute-as-licence' => $redistribute_as_licence_id, + '@inbound-licence' => $inbound_licence_id, + '@outbound-licence' => $outbound_licence_id, ]); } diff --git a/web/modules/custom/joinup_licence/src/Entity/CompatibilityDocumentInterface.php b/web/modules/custom/joinup_licence/src/Entity/CompatibilityDocumentInterface.php index f4a4208759..e11540e663 100644 --- a/web/modules/custom/joinup_licence/src/Entity/CompatibilityDocumentInterface.php +++ b/web/modules/custom/joinup_licence/src/Entity/CompatibilityDocumentInterface.php @@ -48,7 +48,7 @@ public function getRedistributeAsLicence(): ?LicenceInterface; * * @return \Drupal\Component\Render\FormattableMarkup * The description, with actual licence names as replacement arguments for - * '@use-licence' and '@redistribute-as-licence'. + * '@inbound-licence' and '@outbound-licence'. */ public function getDescription(): FormattableMarkup; diff --git a/web/modules/custom/joinup_licence/src/Entity/Licence.php b/web/modules/custom/joinup_licence/src/Entity/Licence.php index 8b9f63e495..4acb0c0ecd 100644 --- a/web/modules/custom/joinup_licence/src/Entity/Licence.php +++ b/web/modules/custom/joinup_licence/src/Entity/Licence.php @@ -76,20 +76,20 @@ public function getSpdxLicenceRdfId(): ?string { /** * {@inheritdoc} */ - public function getCompatibilityDocumentId(LicenceInterface $redistribute_as_licence): string { + public function getCompatibilityDocumentId(LicenceInterface $outbound_licence): string { /** @var \Drupal\joinup_licence\JoinupLicenceCompatibilityRulePluginManager $plugin_manager */ $plugin_manager = \Drupal::service('plugin.manager.joinup_licence_compatibility_rule'); - return $plugin_manager->getCompatibilityDocumentId($this, $redistribute_as_licence); + return $plugin_manager->getCompatibilityDocumentId($this, $outbound_licence); } /** * {@inheritdoc} */ - public function getCompatibilityDocument(LicenceInterface $redistribute_as_licence): CompatibilityDocumentInterface { - $compatibility_document_id = $this->getCompatibilityDocumentId($redistribute_as_licence); + public function getCompatibilityDocument(LicenceInterface $outbound_licence): CompatibilityDocumentInterface { + $compatibility_document_id = $this->getCompatibilityDocumentId($outbound_licence); return CompatibilityDocument::load($compatibility_document_id) ->setUseLicence($this) - ->setRedistributeAsLicence($redistribute_as_licence); + ->setRedistributeAsLicence($outbound_licence); } /** diff --git a/web/modules/custom/joinup_licence/src/Entity/LicenceInterface.php b/web/modules/custom/joinup_licence/src/Entity/LicenceInterface.php index 25d5eb20ef..28ddc2da95 100644 --- a/web/modules/custom/joinup_licence/src/Entity/LicenceInterface.php +++ b/web/modules/custom/joinup_licence/src/Entity/LicenceInterface.php @@ -66,7 +66,7 @@ public function getSpdxLicenceRdfId(): ?string; * the current licence can be used in a project which is going to be * distributed under the passed in licence. * - * @param \Drupal\joinup_licence\Entity\LicenceInterface $redistribute_as_licence + * @param \Drupal\joinup_licence\Entity\LicenceInterface $outbound_licence * The licence under which the current code or data is going to be * redistributed. * @@ -76,7 +76,7 @@ public function getSpdxLicenceRdfId(): ?string; * returned, which is the ID of the document explaining the licences are * incompatible. */ - public function getCompatibilityDocumentId(LicenceInterface $redistribute_as_licence): string; + public function getCompatibilityDocumentId(LicenceInterface $outbound_licence): string; /** * Returns the document that details how the licence can be redistributed. @@ -85,14 +85,14 @@ public function getCompatibilityDocumentId(LicenceInterface $redistribute_as_lic * distributed under the current licence can be used in a project which is * going to be distributed under the passed in licence. * - * @param \Drupal\joinup_licence\Entity\LicenceInterface $redistribute_as_licence + * @param \Drupal\joinup_licence\Entity\LicenceInterface $outbound_licence * The licence under which the current code or data is going to be * redistributed. * * @return \Drupal\joinup_licence\Entity\CompatibilityDocumentInterface * The compatibility document that contains the requested information. */ - public function getCompatibilityDocument(LicenceInterface $redistribute_as_licence): CompatibilityDocumentInterface; + public function getCompatibilityDocument(LicenceInterface $outbound_licence): CompatibilityDocumentInterface; /** * Returns the Licence entity that corresponds to the given SPDX ID. diff --git a/web/modules/custom/joinup_licence/src/JoinupLicenceCompatibilityRuleInterface.php b/web/modules/custom/joinup_licence/src/JoinupLicenceCompatibilityRuleInterface.php index b14ecbd326..1fd2332ec7 100644 --- a/web/modules/custom/joinup_licence/src/JoinupLicenceCompatibilityRuleInterface.php +++ b/web/modules/custom/joinup_licence/src/JoinupLicenceCompatibilityRuleInterface.php @@ -14,15 +14,15 @@ interface JoinupLicenceCompatibilityRuleInterface { /** * Checks whether the two licences are verifying this rule. * - * @param \Drupal\joinup_licence\Entity\LicenceInterface $use_licence + * @param \Drupal\joinup_licence\Entity\LicenceInterface $inbound_licence * The licence of an existing project of which the code or data is used. - * @param \Drupal\joinup_licence\Entity\LicenceInterface $redistribute_as_licence + * @param \Drupal\joinup_licence\Entity\LicenceInterface $outbound_licence * The licence under which the modified or extended code or data is going to * be redistributed. * * @return bool * TRUE if the two licences are compatible according to this rule. */ - public function isVerified(LicenceInterface $use_licence, LicenceInterface $redistribute_as_licence): bool; + public function isVerified(LicenceInterface $inbound_licence, LicenceInterface $outbound_licence): bool; } diff --git a/web/modules/custom/joinup_licence/src/JoinupLicenceCompatibilityRulePluginBase.php b/web/modules/custom/joinup_licence/src/JoinupLicenceCompatibilityRulePluginBase.php index ca6d29d7b4..162a63a3bb 100644 --- a/web/modules/custom/joinup_licence/src/JoinupLicenceCompatibilityRulePluginBase.php +++ b/web/modules/custom/joinup_licence/src/JoinupLicenceCompatibilityRulePluginBase.php @@ -15,21 +15,21 @@ abstract class JoinupLicenceCompatibilityRulePluginBase extends PluginBase imple /** * The criteria to which the use licence should adhere. */ - const USE_CRITERIA = []; + const INBOUND_CRITERIA = []; /** * The criteria to which the use redistribute as licence should adhere. */ - const REDISTRIBUTE_AS_CRITERIA = []; + const OUTBOUND_CRITERIA = []; /** * {@inheritdoc} */ - public function isVerified(LicenceInterface $use_licence, LicenceInterface $redistribute_as_licence): bool { + public function isVerified(LicenceInterface $inbound_licence, LicenceInterface $outbound_licence): bool { /** @var \Drupal\joinup_licence\Entity\LicenceInterface $licence */ foreach ([ - [$use_licence, static::USE_CRITERIA], - [$redistribute_as_licence, static::REDISTRIBUTE_AS_CRITERIA], + [$inbound_licence, static::INBOUND_CRITERIA], + [$outbound_licence, static::OUTBOUND_CRITERIA], ] as [$licence, $criteria]) { foreach ($criteria as $type => $matches) { switch ($type) { diff --git a/web/modules/custom/joinup_licence/src/JoinupLicenceCompatibilityRulePluginManager.php b/web/modules/custom/joinup_licence/src/JoinupLicenceCompatibilityRulePluginManager.php index 733fbc04f6..f86889ec50 100644 --- a/web/modules/custom/joinup_licence/src/JoinupLicenceCompatibilityRulePluginManager.php +++ b/web/modules/custom/joinup_licence/src/JoinupLicenceCompatibilityRulePluginManager.php @@ -51,9 +51,9 @@ public function __construct(\Traversable $namespaces, CacheBackendInterface $cac * the current licence can be used in a project which is going to be * distributed under the passed in licence. * - * @param \Drupal\joinup_licence\Entity\LicenceInterface $use_licence + * @param \Drupal\joinup_licence\Entity\LicenceInterface $inbound_licence * The licence of an existing project of which the code or data is used. - * @param \Drupal\joinup_licence\Entity\LicenceInterface $redistribute_as_licence + * @param \Drupal\joinup_licence\Entity\LicenceInterface $outbound_licence * The licence under which the modified or extended code or data is going to * be redistributed. * @@ -65,11 +65,11 @@ public function __construct(\Traversable $namespaces, CacheBackendInterface $cac * @throws \Drupal\Component\Plugin\Exception\PluginException * If the plugin being created is missing. */ - public function getCompatibilityDocumentId(LicenceInterface $use_licence, LicenceInterface $redistribute_as_licence): string { + public function getCompatibilityDocumentId(LicenceInterface $inbound_licence, LicenceInterface $outbound_licence): string { foreach ($this->getDefinitions() as $plugin_id => $plugin_definition) { /** @var \Drupal\joinup_licence\JoinupLicenceCompatibilityRuleInterface $rule */ $rule = $this->createInstance($plugin_id); - if ($rule->isVerified($use_licence, $redistribute_as_licence)) { + if ($rule->isVerified($inbound_licence, $outbound_licence)) { // Return the first compatible result. Note that the plugin definitions // were already sorted by their weight after discovery. return $plugin_id; diff --git a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/IncompatibleLicences.php b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/IncompatibleLicences.php index 85bbf51f30..b9708e2000 100644 --- a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/IncompatibleLicences.php +++ b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/IncompatibleLicences.php @@ -19,7 +19,7 @@ class IncompatibleLicences extends JoinupLicenceCompatibilityRulePluginBase { /** * {@inheritdoc} */ - public function isVerified(LicenceInterface $use_licence, LicenceInterface $redistribute_as_licence): bool { + public function isVerified(LicenceInterface $inbound_licence, LicenceInterface $outbound_licence): bool { return TRUE; } diff --git a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T01IdenticalLicence.php b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T01IdenticalLicence.php index 961cba6b56..8ae4bbc6ca 100644 --- a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T01IdenticalLicence.php +++ b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T01IdenticalLicence.php @@ -25,8 +25,8 @@ class T01IdenticalLicence extends JoinupLicenceCompatibilityRulePluginBase { /** * {@inheritdoc} */ - public function isVerified(LicenceInterface $use_licence, LicenceInterface $redistribute_as_licence): bool { - return $use_licence->getSpdxLicenceId() === $redistribute_as_licence->getSpdxLicenceId(); + public function isVerified(LicenceInterface $inbound_licence, LicenceInterface $outbound_licence): bool { + return $inbound_licence->getSpdxLicenceId() === $outbound_licence->getSpdxLicenceId(); } } diff --git a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T02Eupl11IsCompatibleWithGpl2.php b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T02Eupl11IsCompatibleWithGpl2.php index b381839949..b21d06a792 100644 --- a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T02Eupl11IsCompatibleWithGpl2.php +++ b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T02Eupl11IsCompatibleWithGpl2.php @@ -21,7 +21,7 @@ */ class T02Eupl11IsCompatibleWithGpl2 extends JoinupLicenceCompatibilityRulePluginBase { - const USE_CRITERIA = ['SPDX' => ['GPL-2.0-only', 'GPL-2.0+']]; - const REDISTRIBUTE_AS_CRITERIA = ['SPDX' => ['EUPL-1.1']]; + const INBOUND_CRITERIA = ['SPDX' => ['GPL-2.0-only', 'GPL-2.0+']]; + const OUTBOUND_CRITERIA = ['SPDX' => ['EUPL-1.1']]; } diff --git a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T03Eupl11IsCompatibleWithGpl3.php b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T03Eupl11IsCompatibleWithGpl3.php index dad2722a0d..2eec0b348f 100644 --- a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T03Eupl11IsCompatibleWithGpl3.php +++ b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T03Eupl11IsCompatibleWithGpl3.php @@ -21,13 +21,13 @@ */ class T03Eupl11IsCompatibleWithGpl3 extends JoinupLicenceCompatibilityRulePluginBase { - const USE_CRITERIA = [ + const INBOUND_CRITERIA = [ 'SPDX' => [ 'AGPL-3.0-only', 'GPL-3.0-only', 'GPL-3.0-or-later', ], ]; - const REDISTRIBUTE_AS_CRITERIA = ['SPDX' => ['EUPL-1.1']]; + const OUTBOUND_CRITERIA = ['SPDX' => ['EUPL-1.1']]; } diff --git a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T04Eupl12IsCompatibleWithGpl.php b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T04Eupl12IsCompatibleWithGpl.php index e8a69652d0..ba0e4aa3a9 100644 --- a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T04Eupl12IsCompatibleWithGpl.php +++ b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T04Eupl12IsCompatibleWithGpl.php @@ -21,7 +21,7 @@ */ class T04Eupl12IsCompatibleWithGpl extends JoinupLicenceCompatibilityRulePluginBase { - const USE_CRITERIA = [ + const INBOUND_CRITERIA = [ 'SPDX' => [ 'AGPL-3.0-only', 'GPL-2.0+', @@ -30,6 +30,6 @@ class T04Eupl12IsCompatibleWithGpl extends JoinupLicenceCompatibilityRulePluginB 'GPL-3.0-or-later', ], ]; - const REDISTRIBUTE_AS_CRITERIA = ['SPDX' => ['EUPL-1.2']]; + const OUTBOUND_CRITERIA = ['SPDX' => ['EUPL-1.2']]; } diff --git a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T05Gpl2andGpl3AreCompatible.php b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T05Gpl2andGpl3AreCompatible.php index a8fb818851..45cbb148b0 100644 --- a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T05Gpl2andGpl3AreCompatible.php +++ b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T05Gpl2andGpl3AreCompatible.php @@ -21,13 +21,13 @@ */ class T05Gpl2andGpl3AreCompatible extends JoinupLicenceCompatibilityRulePluginBase { - const USE_CRITERIA = [ + const INBOUND_CRITERIA = [ 'SPDX' => [ 'GPL-2.0-only', 'GPL-3.0-only', ], ]; - const REDISTRIBUTE_AS_CRITERIA = [ + const OUTBOUND_CRITERIA = [ 'SPDX' => [ 'GPL-2.0-only', 'GPL-3.0-only', diff --git a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T06Eupl11andEupl12AreCompatible.php b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T06Eupl11andEupl12AreCompatible.php index a1ed0f1656..f3190e6c12 100644 --- a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T06Eupl11andEupl12AreCompatible.php +++ b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T06Eupl11andEupl12AreCompatible.php @@ -21,13 +21,13 @@ */ class T06Eupl11andEupl12AreCompatible extends JoinupLicenceCompatibilityRulePluginBase { - const USE_CRITERIA = [ + const INBOUND_CRITERIA = [ 'SPDX' => [ 'EUPL-1.1', 'EUPL-1.2', ], ]; - const REDISTRIBUTE_AS_CRITERIA = [ + const OUTBOUND_CRITERIA = [ 'SPDX' => [ 'EUPL-1.1', 'EUPL-1.2', diff --git a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T07GplCompatibleLicencesAreCompatibleWithGpl.php b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T07GplCompatibleLicencesAreCompatibleWithGpl.php index c6bb7288c1..56dd47a020 100644 --- a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T07GplCompatibleLicencesAreCompatibleWithGpl.php +++ b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T07GplCompatibleLicencesAreCompatibleWithGpl.php @@ -21,7 +21,7 @@ */ class T07GplCompatibleLicencesAreCompatibleWithGpl extends JoinupLicenceCompatibilityRulePluginBase { - const USE_CRITERIA = [ + const INBOUND_CRITERIA = [ 'SPDX' => [ 'AGPL-3.0-only', 'GPL-2.0+', @@ -30,7 +30,7 @@ class T07GplCompatibleLicencesAreCompatibleWithGpl extends JoinupLicenceCompatib 'GPL-3.0-or-later', ], ]; - const REDISTRIBUTE_AS_CRITERIA = [ + const OUTBOUND_CRITERIA = [ 'Compatible' => [ 'GPL', ], diff --git a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T08Eupl11CanBeRelicensedAsGpl2AndOthers.php b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T08Eupl11CanBeRelicensedAsGpl2AndOthers.php index df220d8a54..fd6f6c6ae6 100644 --- a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T08Eupl11CanBeRelicensedAsGpl2AndOthers.php +++ b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T08Eupl11CanBeRelicensedAsGpl2AndOthers.php @@ -21,12 +21,12 @@ */ class T08Eupl11CanBeRelicensedAsGpl2AndOthers extends JoinupLicenceCompatibilityRulePluginBase { - const USE_CRITERIA = [ + const INBOUND_CRITERIA = [ 'SPDX' => [ 'EUPL-1.1', ], ]; - const REDISTRIBUTE_AS_CRITERIA = [ + const OUTBOUND_CRITERIA = [ 'SPDX' => [ 'CECILL-2.0', 'CECILL-2.1', diff --git a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T09Eupl11CanBeRelicensedAsGpl3.php b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T09Eupl11CanBeRelicensedAsGpl3.php index 5d3d86f2f8..48d285b983 100644 --- a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T09Eupl11CanBeRelicensedAsGpl3.php +++ b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T09Eupl11CanBeRelicensedAsGpl3.php @@ -21,12 +21,12 @@ */ class T09Eupl11CanBeRelicensedAsGpl3 extends JoinupLicenceCompatibilityRulePluginBase { - const USE_CRITERIA = [ + const INBOUND_CRITERIA = [ 'SPDX' => [ 'EUPL-1.1', ], ]; - const REDISTRIBUTE_AS_CRITERIA = [ + const OUTBOUND_CRITERIA = [ 'SPDX' => [ 'AGPL-3.0-only', 'GPL-3.0-only', diff --git a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T10Eupl12CanBeRelicensedAsGplAndOthers.php b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T10Eupl12CanBeRelicensedAsGplAndOthers.php index 11741fe35b..6efd25d237 100644 --- a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T10Eupl12CanBeRelicensedAsGplAndOthers.php +++ b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T10Eupl12CanBeRelicensedAsGplAndOthers.php @@ -21,12 +21,12 @@ */ class T10Eupl12CanBeRelicensedAsGplAndOthers extends JoinupLicenceCompatibilityRulePluginBase { - const USE_CRITERIA = [ + const INBOUND_CRITERIA = [ 'SPDX' => [ 'EUPL-1.2', ], ]; - const REDISTRIBUTE_AS_CRITERIA = [ + const OUTBOUND_CRITERIA = [ 'SPDX' => [ 'AGPL-3.0-only', 'CC-BY-SA-4.0', diff --git a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T11GovernmentalLicencesCanBeRelicensedAsEupl.php b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T11GovernmentalLicencesCanBeRelicensedAsEupl.php index 796ee972ca..0d262172b6 100644 --- a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T11GovernmentalLicencesCanBeRelicensedAsEupl.php +++ b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T11GovernmentalLicencesCanBeRelicensedAsEupl.php @@ -21,13 +21,13 @@ */ class T11GovernmentalLicencesCanBeRelicensedAsEupl extends JoinupLicenceCompatibilityRulePluginBase { - const USE_CRITERIA = [ + const INBOUND_CRITERIA = [ 'SPDX' => [ 'CECILL-2.1', 'LiLiQ-Rplus-1.1', ], ]; - const REDISTRIBUTE_AS_CRITERIA = [ + const OUTBOUND_CRITERIA = [ 'SPDX' => [ 'EUPL-1.1', 'EUPL-1.2', diff --git a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T12AnyLicenceCanRedistributePermissiveLicence.php b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T12AnyLicenceCanRedistributePermissiveLicence.php index f8b3c941c7..0e9851b7cc 100644 --- a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T12AnyLicenceCanRedistributePermissiveLicence.php +++ b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T12AnyLicenceCanRedistributePermissiveLicence.php @@ -25,8 +25,8 @@ class T12AnyLicenceCanRedistributePermissiveLicence extends JoinupLicenceCompati /** * {@inheritdoc} */ - public function isVerified(LicenceInterface $use_licence, LicenceInterface $redistribute_as_licence): bool { - return $use_licence->hasLegalType('Compatible', 'Permissive'); + public function isVerified(LicenceInterface $inbound_licence, LicenceInterface $outbound_licence): bool { + return $inbound_licence->hasLegalType('Compatible', 'Permissive'); } } diff --git a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T13GplIsCompatibleWithGplCompatibleLicences.php b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T13GplIsCompatibleWithGplCompatibleLicences.php index 573769a1e1..8811d6ae15 100644 --- a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T13GplIsCompatibleWithGplCompatibleLicences.php +++ b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T13GplIsCompatibleWithGplCompatibleLicences.php @@ -21,12 +21,12 @@ */ class T13GplIsCompatibleWithGplCompatibleLicences extends JoinupLicenceCompatibilityRulePluginBase { - const USE_CRITERIA = [ + const INBOUND_CRITERIA = [ 'Compatible' => [ 'GPL', ], ]; - const REDISTRIBUTE_AS_CRITERIA = [ + const OUTBOUND_CRITERIA = [ 'SPDX' => [ 'AGPL-3.0-only', 'GPL-2.0+', diff --git a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T14CopyLeftCanBeDistributedAsPermissiveIfUnchanged.php b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T14CopyLeftCanBeDistributedAsPermissiveIfUnchanged.php index 897a3fb48c..50d9a0b020 100644 --- a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T14CopyLeftCanBeDistributedAsPermissiveIfUnchanged.php +++ b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T14CopyLeftCanBeDistributedAsPermissiveIfUnchanged.php @@ -21,13 +21,13 @@ */ class T14CopyLeftCanBeDistributedAsPermissiveIfUnchanged extends JoinupLicenceCompatibilityRulePluginBase { - const USE_CRITERIA = [ + const INBOUND_CRITERIA = [ 'Must' => [ 'Copyleft/Share a.', 'Lesser copyleft', ], ]; - const REDISTRIBUTE_AS_CRITERIA = [ + const OUTBOUND_CRITERIA = [ 'Compatible' => [ 'Permissive', ], diff --git a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T15CopyLeftCanBeDistributedAsAnotherCopyLeft.php b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T15CopyLeftCanBeDistributedAsAnotherCopyLeft.php index b491e6bdb9..5fee7b135f 100644 --- a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T15CopyLeftCanBeDistributedAsAnotherCopyLeft.php +++ b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T15CopyLeftCanBeDistributedAsAnotherCopyLeft.php @@ -21,13 +21,13 @@ */ class T15CopyLeftCanBeDistributedAsAnotherCopyLeft extends JoinupLicenceCompatibilityRulePluginBase { - const USE_CRITERIA = [ + const INBOUND_CRITERIA = [ 'Must' => [ 'Copyleft/Share a.', 'Lesser copyleft', ], ]; - const REDISTRIBUTE_AS_CRITERIA = [ + const OUTBOUND_CRITERIA = [ 'Must' => [ 'Copyleft/Share a.', ], diff --git a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T16CopyLeftCanBeDistributedAsLesserCopyLeft.php b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T16CopyLeftCanBeDistributedAsLesserCopyLeft.php index ecd2309c81..2f23d40114 100644 --- a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T16CopyLeftCanBeDistributedAsLesserCopyLeft.php +++ b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T16CopyLeftCanBeDistributedAsLesserCopyLeft.php @@ -21,12 +21,12 @@ */ class T16CopyLeftCanBeDistributedAsLesserCopyLeft extends JoinupLicenceCompatibilityRulePluginBase { - const USE_CRITERIA = [ + const INBOUND_CRITERIA = [ 'Must' => [ 'Copyleft/Share a.', ], ]; - const REDISTRIBUTE_AS_CRITERIA = [ + const OUTBOUND_CRITERIA = [ 'Must' => [ 'Lesser copyleft', ], diff --git a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T17ForSoftwareVsForData.php b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T17ForSoftwareVsForData.php index bd3aa67bec..44ca96b3cc 100644 --- a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T17ForSoftwareVsForData.php +++ b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T17ForSoftwareVsForData.php @@ -21,12 +21,12 @@ */ class T17ForSoftwareVsForData extends JoinupLicenceCompatibilityRulePluginBase { - const USE_CRITERIA = [ + const INBOUND_CRITERIA = [ 'Compatible' => [ 'For software', ], ]; - const REDISTRIBUTE_AS_CRITERIA = [ + const OUTBOUND_CRITERIA = [ 'Compatible' => [ 'For data', ], diff --git a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T18ForDataVsForSoftware.php b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T18ForDataVsForSoftware.php index 9512f90984..c94789931e 100644 --- a/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T18ForDataVsForSoftware.php +++ b/web/modules/custom/joinup_licence/src/Plugin/JoinupLicenceCompatibilityRule/T18ForDataVsForSoftware.php @@ -21,12 +21,12 @@ */ class T18ForDataVsForSoftware extends JoinupLicenceCompatibilityRulePluginBase { - const USE_CRITERIA = [ + const INBOUND_CRITERIA = [ 'Compatible' => [ 'For data', ], ]; - const REDISTRIBUTE_AS_CRITERIA = [ + const OUTBOUND_CRITERIA = [ 'Compatible' => [ 'For software', ], diff --git a/web/themes/joinup/templates/rdf_entity/rdf-entity--licence--compatibility-check.html.twig b/web/themes/joinup/templates/rdf_entity/rdf-entity--licence--compatibility-check.html.twig index 64f34ab937..b58e6b20b9 100644 --- a/web/themes/joinup/templates/rdf_entity/rdf-entity--licence--compatibility-check.html.twig +++ b/web/themes/joinup/templates/rdf_entity/rdf-entity--licence--compatibility-check.html.twig @@ -54,10 +54,10 @@ <label> tag in ISAICP-5687. See https://citnet.tech.ec.europa.eu/CITnet/jira/browse/ISAICP-5687. #} - <label for="{{ url|clean_id }}">{{ 'Use'|t }}</label> + <label for="{{ url|clean_id }}">{{ 'Inbound'|t }}</label> </span> {% endspaceless %} - <input type="radio" id="{{ url|clean_id }}" class="mdl-radio__button" name="use-licence" data-licence-name="{{ spdx_licence_id_plain }}"> + <input type="radio" id="{{ url|clean_id }}" class="mdl-radio__button" name="inbound-licence" data-licence-name="{{ spdx_licence_id_plain }}"> </label> <label class="mdl-radio mdl-js-radio mdl-js-ripple-effect"> {% spaceless %} @@ -68,10 +68,10 @@ <label> tag in ISAICP-5687. See https://citnet.tech.ec.europa.eu/CITnet/jira/browse/ISAICP-5687. #} - <label for="{{ url|clean_id }}">{{ 'Distribute'|t }}</label> + <label for="{{ url|clean_id }}">{{ 'Outbound'|t }}</label> </span> {% endspaceless %} - <input type="radio" id="{{ url|clean_id }}" class="mdl-radio__button" name="distribute-as-licence" data-licence-name="{{ spdx_licence_id_plain }}"> + <input type="radio" id="{{ url|clean_id }}" class="mdl-radio__button" name="outbound-licence" data-licence-name="{{ spdx_licence_id_plain }}"> </label> </div> <div class="licence-tile__actions-item">