Skip to content
Snippets Groups Projects
Commit 809b4f57 authored by Claudiu Cristea's avatar Claudiu Cristea
Browse files

Merge branch 'ISAICP-7466' into 'master'

ISAICP-7466: Can't add news

See merge request !58
parents a3443012 3f63fd12
No related branches found
Tags v1.88.1
1 merge request!58ISAICP-7466: Can't add news
......@@ -13,6 +13,7 @@ dependencies:
- file
- image
- paragraphs
- path
id: node.custom_page.default
targetEntityType: node
bundle: custom_page
......@@ -59,6 +60,12 @@ content:
settings:
include_locked: true
third_party_settings: { }
path:
type: path
weight: 7
region: content
settings: { }
third_party_settings: { }
status:
type: boolean_checkbox
weight: 6
......@@ -83,7 +90,6 @@ hidden:
created: true
current_workflow_state: true
og_audience: true
path: true
promote: true
published_at: true
sticky: true
......
......@@ -31,12 +31,29 @@ Feature: "Custom page" editing.
# A moderator can edit all custom pages.
When I am logged in as a user with the moderator role
And I go to the "Buena Vista Distribution Company" custom page
# Moderators have the 'administer nodes' permission.
Then I should see the link "Edit"
When I click "Edit"
Then I should see the heading "Edit Custom page Buena Vista Distribution Company"
And the following fields should be present "Title, Body, Published"
And the following fields should not be present "Groups audience, Other groups, Generate automatic URL alias, URL alias"
And I should not see the following lines of text:
| Authored on |
| Create new revision |
| URL alias (Automatic alias) |
| Generate automatic URL alias |
| Uncheck this to create a custom alias below. |
| Groups audience |
| Other groups |
| Promoted to front page |
| Revision information |
| Revision log message |
| Sticky at top of lists |
# A normal logged in user should not be able to edit the custom page.
When I am logged in as a user with the authenticated role
And I go to the "Buena Vista Distribution Company" custom page
Then I should not see the link "Edit"
# An anonymous user cannot edit the custom page.
When I am logged in as a user with the authenticated role
And I go to the "Buena Vista Distribution Company" custom page
......@@ -48,7 +65,21 @@ Feature: "Custom page" editing.
And I click "Edit"
Then I should see the heading "Edit Custom page Buena Vista Distribution Company"
And the following fields should be present "Title, Body, Published"
And the following fields should not be present "Groups audience, Other groups"
And the following fields should not be present "Groups audience, Other groups, URL alias"
And the following fields should not be present "Groups audience, Other groups, Generate automatic URL alias, URL alias"
And I should not see the following lines of text:
| Authored on |
| Create new revision |
| URL alias (Automatic alias) |
| Generate automatic URL alias |
| Uncheck this to create a custom alias below. |
| Groups audience |
| Other groups |
| Promoted to front page |
| Revision information |
| Revision log message |
| Sticky at top of lists |
When I fill in "Title" with "Walt Disney Studios Motion Pictures"
And I press "Save"
Then I should have a "Custom page" content page titled "Walt Disney Studios Motion Pictures"
......
@api @group-clone
Feature: Covers \joinup_core_deploy_108900().
Scenario: Test that news creation works.
Given I am logged in as a moderator
And I am on the homepage
When I click "Interoperable Europe"
And I click "News"
Then the url should match "/interoperable-europe/latest-news"
When I click "Add news" in the plus button menu
Then the response status code should be 200
And the url should match "/interoperable-europe/news/add"
And I should see the heading "Add news"
......@@ -14,62 +14,16 @@
declare(strict_types = 1);
use Drupal\interoperable_europe\InteroperableEuropeCollectionInterface;
use Drupal\pathauto\PathautoState;
/**
* Import new landing page.
* Fix Interoperable Europe news creation link.
*/
function joinup_core_deploy_108800(): void {
/** @var \Drupal\Core\Extension\ModuleInstallerInterface $module_installer */
$module_installer = \Drupal::service('module_installer');
/** @var \Drupal\Core\Entity\EntityRepositoryInterface $entity_repository */
$entity_repository = \Drupal::service('entity.repository');
// Import new content.
$module_installer->install(['default_content']);
/** @var \Drupal\default_content\ImporterInterface $importer */
\Drupal::service('default_content.importer')->importContent('interoperable_europe', TRUE);
$module_installer->uninstall(['default_content']);
// Disable auto-created left-side menu link.
$landing_page = $entity_repository->loadEntityByUuid('node', '61e83391-9f96-4c9e-995d-9b22705b9f9f');
$link_plugins = \Drupal::service('plugin.manager.menu.link')->loadLinksByRoute('entity.node.canonical', [
'node' => $landing_page->id(),
], 'ogmenu-3600');
/** @var \Drupal\menu_link_content\Plugin\Menu\MenuLinkContent $link_plugin */
$link_plugin = reset($link_plugins);
$entity_repository
->loadEntityByUuid('menu_link_content', $link_plugin->getDerivativeId())
->setUnpublished()
->save();
// Remove old IOP landing page.
\Drupal::entityTypeManager()->getStorage('node')->load(704740)->delete();
}
/**
* Update path alias IOPE.
*/
function joinup_core_deploy_108801(): void {
/** @var \Drupal\collection\Entity\CollectionInterface $collection */
$collection = \Drupal::entityTypeManager()
->getStorage('rdf_entity')
->load(InteroperableEuropeCollectionInterface::COLLECTION_ENTITY_ID);
// Get all entities from IOPE.
$content = $collection->getGroupContentIds();
$collection->path = ['alias' => '/interoperable-europe', 'pathauto' => 0];
$collection->save();
// Update entities in IOPE group.
foreach ($content as $type => $entities) {
foreach ($entities as $ids) {
foreach ($ids as $id) {
$entity = \Drupal::entityTypeManager()->getStorage($type)->load($id);
$entity->path = ['pathauto' => 1];
$entity->save();
}
}
}
function joinup_core_deploy_108900(): void {
$entityTypeManager = \Drupal::entityTypeManager();
$entityTypeManager->getStorage('node')->load(704825)->set('path', [
'pathauto' => PathautoState::SKIP,
'alias' => '/interoperable-europe/latest-news',
])->save();
$entityTypeManager->getStorage('path_alias')->load(84170)->delete();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment