Skip to content

Commit

Permalink
Merge pull request #3 from localgovdrupal/1/rename-modules-fields-ent…
Browse files Browse the repository at this point in the history
…ities

Update composer.json.
  • Loading branch information
finnlewis authored Jun 20, 2024
2 parents 560aa72 + 94fb242 commit 5abb36e
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "localgovdrupal/localgov_elections",
"description": "Module to report on elections for LocalGovDrupal sites.",
"description": "Module to report on elections for LocalGov Drupal sites.",
"type": "drupal-module",
"homepage": "https://gitlab.com/rohallion/localgov_elections",
"homepage": "https://github.com/localgovdrupal/localgov_elections",
"license": "GPL-2.0-or-later",
"minimum-stability": "dev",
"require": {
Expand Down
4 changes: 0 additions & 4 deletions localgov_elections.install
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@
*/

use Drupal\Core\Config\FileStorage;
use Drupal\Core\Entity\Entity\EntityFormDisplay;
use Drupal\Core\Entity\EntityStorageException;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Entity\FieldStorageConfig;
use Symfony\Component\Yaml\Yaml;

/**
* Implements hook_install().
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\localgov_elections_constituency_provider\CacheKey;
use Drupal\localgov_elections\BoundaryProviderInterface;
use Drupal\localgov_elections\Form\BoundaryProviderSubformInterface;
use Drupal\localgov_elections_constituency_provider\CacheKey;
use GuzzleHttp\Client;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\RequestStack;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected function setUp(): void {
$this->election = $storage->create([
'title' => "UK Election 2024",
'status' => TRUE,
'type' => "election",
'type' => "localgov_election",
]);

$this->election->save();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ protected function setUp(): void {
$this->election = $storage->create([
'title' => "UK Election 2024",
'status' => TRUE,
'type' => "election",
'type' => "localgov_election",
]);

$this->election->save();
Expand Down
2 changes: 1 addition & 1 deletion src/Event/NodeInsertDivisionVotes.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
class NodeInsertDivisionVotes extends Event {

const localgov_elections_NODE_INSERT = 'localgov_elections.node.insert';
const LOCALGOV_ELECTIONS_NODE_INSERT = 'localgov_elections.node.insert';

/**
* Node entity.
Expand Down
4 changes: 2 additions & 2 deletions src/Plugin/Block/AnalysisBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ public function build() {
$previous_winner_abbr = $previous_winning_party->localgov_election_abbreviation->value;
}

// If previous year not manually set, look if previous 'localgov_area_vote'
// been set.
// If previous year not manually set, look if previous
// 'localgov_area_vote' has been set.
if (isset($previous_result)) {
// phpcs:ignore
$previous_localgov_area_vote = Node::load($previous_result->id());
Expand Down
3 changes: 2 additions & 1 deletion src/Plugin/Block/PartySeatsBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ public function build() {
$nid = $election->id();
$election_parties = [];

// Find all 'Areas vote' (localgov_area_vote) nodes referencing this election.
// Find all 'Areas vote' (localgov_area_vote) nodes referencing this
// election.
// phpcs:ignore
$query = \Drupal::entityQuery('node')
->condition('type', 'localgov_area_vote')
Expand Down
3 changes: 2 additions & 1 deletion src/Plugin/views/field/ElectionSeatsParty.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public function render(ResultRow $values) {
// Arg must be NID of an Election content type.
if ($node->getType() == 'localgov_election') {
$election = $node->id();
// Find all 'Area vote' (localgov_area_vote) nodes referencing this election.
// Find all 'Area vote' (localgov_area_vote) nodes referencing this
// election.
$query = \Drupal::entityQuery('node')
->condition('type', 'localgov_area_vote')
->condition('localgov_election', $election);
Expand Down
3 changes: 2 additions & 1 deletion src/Plugin/views/field/ElectionShare.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ public function render(ResultRow $values) {
// Arg must be NID of an Election content type.
if ($node->getType() == 'localgov_election') {
// $election = $node->id();
// Find all 'Area vote' (localgov_area_vote) nodes referencing this election
// Find all 'Area vote' (localgov_area_vote) nodes referencing this
// election.
$query = \Drupal::entityQuery('node')
->condition('type', 'localgov_area_vote')
->condition('localgov_election', $election);
Expand Down
3 changes: 2 additions & 1 deletion src/Plugin/views/field/PartyName.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ public function render(ResultRow $values) {
$party_name = NULL;
$results = [];

// Find all 'Areas vote' (localgov_area_vote) nodes referencing this election.
// Find all 'Areas vote' (localgov_area_vote) nodes referencing this
// election.
$query = \Drupal::entityQuery('node')
->condition('type', 'localgov_area_vote')
->condition('localgov_election', $election);
Expand Down

0 comments on commit 5abb36e

Please sign in to comment.