Skip to content

Commit

Permalink
Merge branch 'hotfix/1.11.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
abrain committed Aug 18, 2024
2 parents f4e35e5 + 0508be5 commit fd378f6
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ setupLocalTest.sh
vendor
.DS_Store
.php_cs.cache
.php-cs-fixer.cache
.phpunit.result.cache
1 change: 1 addition & 0 deletions .phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
</rule>

<rule ref="WordPress.NamingConventions.PrefixAllGlobals">
<exclude-pattern>tests/</exclude-pattern>
<properties>
<property name="prefixes" type="array">
<element value="einsatzverwaltung"/>
Expand Down
2 changes: 1 addition & 1 deletion src/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*/
class Core
{
const VERSION = '1.11.1';
const VERSION = '1.11.2';
const DB_VERSION = 80;

/**
Expand Down
8 changes: 8 additions & 0 deletions src/Frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ public function addHooks()
add_filter('the_excerpt_embed', array($this, 'filterEinsatzExcerpt'));
add_action('pre_get_posts', array($this, 'addReportsToQuery'));
add_filter('default_post_metadata', array($this, 'filterDefaultThumbnail'), 10, 3);

// Adjustment for Avada theme
add_action('awb_remove_third_party_the_content_changes', function () {
remove_filter('the_content', array($this, 'renderContent'), 9);
}, 5);
add_action('awb_readd_third_party_the_content_changes', function () {
add_filter('the_content', array($this, 'renderContent'), 9);
}, 99);
}

/**
Expand Down
6 changes: 6 additions & 0 deletions src/css/style-frontend.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
border-bottom: 2px solid #ddd;
}

.einsatzverwaltung-reportlist .einsatz-column-number,
.einsatzverwaltung-reportlist .einsatz-column-date,
.einsatzverwaltung-reportlist .einsatz-column-time {
white-space: nowrap;
}

.einsatzverwaltung-reportlist .zebracorrection {
visibility: hidden;
display: none;
Expand Down
2 changes: 1 addition & 1 deletion src/einsatzverwaltung.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Einsatzverwaltung
Plugin URI: https://einsatzverwaltung.org
Description: Public incident reports for fire departments and other rescue services
Version: 1.11.1
Version: 1.11.2
Author: Andreas Brain
Author URI: https://www.abrain.de
License: GPLv2
Expand Down
13 changes: 10 additions & 3 deletions src/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Contributors: abrain
Donate link: https://einsatzverwaltung.org/unterstuetzen/
Tags: Feuerwehr, fire department, EMS
Requires at least: 5.6.0
Tested up to: 6.5
Tested up to: 6.6
Requires PHP: 7.1.0
Stable tag: 1.11.1
Stable tag: 1.11.2
License: GPLv2
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand All @@ -30,7 +30,7 @@ Uses Font Awesome by Dave Gandy - http://fontawesome.io

== Installation ==

The plugin does not require any setup but it is recommended to take a look at the settings before you start publishing. Especially those in the Advanced section should not be changed inconsiderately later on.
The plugin does not require any setup, but it is recommended to take a look at the settings before you start publishing. Especially those in the Advanced section should not be changed inconsiderately later on.

== Frequently Asked Questions ==

Expand All @@ -52,6 +52,10 @@ Yes, you can find them on [our website](https://einsatzverwaltung.org/faq/).

== Changelog ==

= 1.11.2 =
* Fix: Content was duplicated when using the Avada Website Builder
* Fix: Prevent linebreaks for certain columns of the report list

= 1.11.1 =
* Reduce collisions with other occurrences of Font Awesome
* Add option to disable Font Awesome
Expand Down Expand Up @@ -79,6 +83,9 @@ Yes, you can find them on [our website](https://einsatzverwaltung.org/faq/).
* Fix: Changing the category setting for incident reports caused an error on fresh installations

== Upgrade Notice ==
= 1.11.2 =
Maintenance Release

= 1.11.1 =
Maintenance Release

Expand Down
44 changes: 44 additions & 0 deletions tests/unit/FrontendTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

namespace abrain\Einsatzverwaltung;

use Mockery;
use function Brain\Monkey\Actions\expectAdded;

/**
* @covers \abrain\Einsatzverwaltung\Frontend
*/
class FrontendTest extends UnitTestCase
{
public function testAddsHooks()
{
expectAdded('awb_readd_third_party_the_content_changes')->once()->with(Mockery::type('Closure'), 99);
expectAdded('awb_remove_third_party_the_content_changes')->once()->with(Mockery::type('Closure'), 5);

$options = Mockery::mock('abrain\Einsatzverwaltung\Options');
$formatter = Mockery::mock('abrain\Einsatzverwaltung\Util\Formatter');
$frontend = new Frontend($options, $formatter);
$frontend->addHooks();

self::assertSame(10, has_action('pre_get_posts', 'abrain\Einsatzverwaltung\Frontend->addReportsToQuery()'));
self::assertSame(10, has_action('wp_enqueue_scripts', 'abrain\Einsatzverwaltung\Frontend->enqueueStyleAndScripts()'));
self::assertSame(10, has_filter('default_post_metadata', 'abrain\Einsatzverwaltung\Frontend->filterDefaultThumbnail()'));
self::assertSame(9, has_filter('the_content', 'abrain\Einsatzverwaltung\Frontend->renderContent()'));
self::assertSame(10, has_filter('the_excerpt', 'abrain\Einsatzverwaltung\Frontend->filterEinsatzExcerpt()'));
self::assertSame(10, has_filter('the_excerpt_rss', 'abrain\Einsatzverwaltung\Frontend->filterEinsatzExcerpt()'));
self::assertSame(10, has_filter('the_excerpt_embed', 'abrain\Einsatzverwaltung\Frontend->filterEinsatzExcerpt()'));
}

public function testDoesNotDisturbAllInOneEventCalendar()
{
$_REQUEST['plugin'] = 'all-in-one-event-calendar';
$_REQUEST['action'] = 'export_events';

$options = Mockery::mock('abrain\Einsatzverwaltung\Options');
$formatter = Mockery::mock('abrain\Einsatzverwaltung\Util\Formatter');
$frontend = new Frontend($options, $formatter);
$frontend->addHooks();

$this->assertFalse(has_filter('the_content'));
}
}

0 comments on commit fd378f6

Please sign in to comment.