Compare commits

..

11 Commits
2 ... 3.0.1

Author SHA1 Message Date
Steve Boyd
c0b557f282 Merge branch '2' into 3.0 2023-06-16 12:18:25 +12:00
Guy Sartorelli
d24f2fa031
Merge branch '2' into 3.0 2023-04-27 14:19:02 +12:00
Sabina Talipova
dd625a8683
Merge pull request #84 from creative-commoners/pulls/3.0/cms5-readme
DOC Update README.md for CMS 5
2023-04-24 14:58:37 +12:00
Guy Sartorelli
a51c30fb0f
DOC Update README.md for CMS 5 2023-04-19 17:01:17 +12:00
Steve Boyd
f00a204f6d Merge branch '2' into 3.0 2023-03-30 12:47:22 +13:00
Steve Boyd
eb3283662c Merge branch '2' into 3.0 2023-03-08 11:54:42 +13:00
Sabina Talipova
002fbf766c
FIX Replace Diff class to HtmlDiff (#80) 2023-02-13 15:51:20 +13:00
Sabina Talipova
a753712806
API Remove deprecated code (#78) 2023-01-25 13:51:11 +13:00
Maxime Rainville
a1eac8de23
Merge pull request #79 from creative-commoners/pulls/3/remove-legacy-upgrader
MNT Remove legacy upgrader config
2023-01-23 10:05:55 +13:00
Steve Boyd
4e0d5ec409 MNT Remove legacy upgrader config 2023-01-20 16:05:31 +13:00
Sabina Talipova
9b92ba8d6c
DEP PHP Support in CMS5 (#77) 2023-01-10 13:24:13 +13:00
8 changed files with 12 additions and 68 deletions

View File

@ -1,12 +0,0 @@
mappings:
VersionFeed: SilverStripe\VersionFeed\VersionFeed
VersionFeed_Controller: SilverStripe\VersionFeed\VersionFeedController
VersionFeedSiteConfig: SilverStripe\VersionFeed\VersionFeedSiteConfig
CachedContentFilter: SilverStripe\VersionFeed\Filters\CachedContentFilter
ContentFilter: SilverStripe\VersionFeed\Filters\ContentFilter
RateLimitFilter: SilverStripe\VersionFeed\Filters\RateLimitFilter
\VersionFeed\Filters\CachedContentFilter: SilverStripe\VersionFeed\Filters\CachedContentFilter
\VersionFeed\Filters\ContentFilter: SilverStripe\VersionFeed\Filters\ContentFilter
\VersionFeed\Filters\RateLimitFilter: SilverStripe\VersionFeed\Filters\RateLimitFilter
VersionFeedFunctionalTest: SilverStripe\VersionFeed\Tests\VersionFeedFunctionalTest
VersionFeedTest: SilverStripe\VersionFeed\Tests\VersionFeedTest

View File

@ -7,15 +7,11 @@
The module creates an RSS feed on each page with their change history, as well as one for the entire site.
## Requirements
* Silverstripe ^4
**Note:** For a Silverstripe 3.x compatible version, please use [the 1.x release line](https://github.com/silverstripe/silverstripe-versionfeed/tree/1.2).
## Installation
Install with composer by running `composer require silverstripe/versionfeed` in the root of your Silverstripe project.
```sh
composer require silverstripe/versionfeed
```
## Usage

View File

@ -16,15 +16,14 @@
}
],
"require": {
"php": "^7.4 || ^8.0",
"silverstripe/cms": "^4",
"silverstripe/versioned": "^1",
"silverstripe/siteconfig": "^4"
"php": "^8.1",
"silverstripe/cms": "^5",
"silverstripe/versioned": "^2",
"silverstripe/siteconfig": "^5"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"silverstripe/framework": "^4.10",
"squizlabs/php_codesniffer": "^3.0"
"squizlabs/php_codesniffer": "^3"
},
"autoload": {
"psr-4": {

View File

@ -6,8 +6,6 @@ eo:
TITLECHANGED: 'Titolo estas ŝanĝita:'
Warning: 'Publikigi la historion ankaŭ malkaŝos la ŝanĝojn ĝis tiam protektitajn kontraŭ publika vido.'
Warning2: 'Ŝanĝi la alirajn agordojn tiel ke ĉi tiu paĝo, aŭ paĝoj sub ĝi, fariĝas publike alireblaj <br>eble rezultigos ke publikiĝos ĉiuj historiaj ŝanĝoj en tiuj paĝoj. Bonvole rekonsideru <br> la sekcion "Publika historio" de ĉi tiu sekcio, por certigi ke nur intencita informo publikiĝu.'
db_PublicHistory: 'Publika historio'
SilverStripe\VersionFeed\VersionFeedSiteConfig:
ALLCHANGES: 'Ĉiuj paĝaj ŝanĝoj'
ALLCHANGESLABEL: 'Ĉieaj ŝanĝoj fluu en publikan'
db_AllChangesEnabled: 'Ĉiuj ŝanĝoj enŝaltitaj'

View File

@ -1,13 +0,0 @@
sk:
SilverStripe\VersionFeed\VersionFeed:
LABEL: 'Zverejniť históriu'
SINGLEPAGEFEEDTITLE: 'Aktualizácie stránky {title}'
SITEFEEDTITLE: 'Aktualizácie {title}'
TITLECHANGED: 'Názov sa zmenil:'
Warning: 'Zverejnením histórie sa zverejnia aj zmeny, ktoré boli v tom čase chránené pred zrakom verejnosti.'
Warning2: 'Zmena nastavení prístupu tak, aby sa táto stránka alebo stránky pod ňou stali verejne prístupné,<br>môže viesť k zverejneniu všetkých historických zmien aj na týchto stránkach.<br> Skontrolujte nastavenia v časti "Verejná história", aby ste sa uistili, že sú zverejnené iba zamýšľané informácie.'
db_PublicHistory: 'Verejná história'
SilverStripe\VersionFeed\VersionFeedSiteConfig:
ALLCHANGES: 'Všetky zmeny stránky'
ALLCHANGESLABEL: 'Zverejnite informačný kanál globálnych zmien'
db_AllChangesEnabled: 'Všetky zmeny povolené'

View File

@ -6,7 +6,6 @@ sl:
TITLECHANGED: 'Spremenjen naslov:'
Warning: 'Objava zgodovine bo razkrila tudi spremembe, ki do sedaj niso bile javno objavljene.'
Warning2: 'Sprememba nastavitev dostopa tako, da so so ta stran ali njene podstrani dostopne javnosti, <br> lahko povzroči objavo tudi vseh sprememb na omenjenih straneh. Podrobno preverite <br> seznam sprememb in se prepričajte, da boste razkrili samo tiste informacije, ki jih želite.'
db_PublicHistory: 'Javna zgodovina'
SilverStripe\VersionFeed\VersionFeedSiteConfig:
ALLCHANGES: 'Vse spremembe'
ALLCHANGESLABEL: 'Javno objavi seznam s krovnimi spremembami'

View File

@ -2,7 +2,6 @@
namespace SilverStripe\VersionFeed;
use SilverStripe\Dev\Deprecation;
use SilverStripe\CMS\Model\SiteTreeExtension;
use SilverStripe\Core\Config\Config;
use SilverStripe\Forms\CheckboxField;
@ -12,7 +11,7 @@ use SilverStripe\ORM\ArrayList;
use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\FieldType\DBField;
use SilverStripe\SiteConfig\SiteConfig;
use SilverStripe\View\Parsers\Diff;
use SilverStripe\View\Parsers\HtmlDiff;
use SilverStripe\CMS\Model\SiteTree;
class VersionFeed extends SiteTreeExtension
@ -80,7 +79,7 @@ class VersionFeed extends SiteTreeExtension
$qLimit = (int)$limit + 1;
$versions = $this->owner->Versions(
"\"WasPublished\"='1' AND \"CanViewType\" IN ('Anyone', 'Inherit') $offset",
"\"SiteTree\".\"LastEdited\" DESC, \"SiteTree\".\"ID\" DESC",
"\"LastEdited\" DESC, \"ID\" DESC",
$qLimit
);
@ -95,7 +94,7 @@ class VersionFeed extends SiteTreeExtension
if (isset($previous)) {
// Produce the diff fields for use in the template.
if ($version->Title != $previous->Title) {
$diffTitle = Diff::compareHTML($version->Title, $previous->Title);
$diffTitle = HtmlDiff::compareHTML($version->Title, $previous->Title);
$version->DiffTitle = DBField::create_field('HTMLText', null);
$version->DiffTitle->setValue(
@ -108,7 +107,7 @@ class VersionFeed extends SiteTreeExtension
}
if ($version->Content != $previous->Content) {
$diffContent = Diff::compareHTML($version->Content, $previous->Content);
$diffContent = HtmlDiff::compareHTML($version->Content, $previous->Content);
$version->DiffContent = DBField::create_field('HTMLText', null);
$version->DiffContent->setValue('<div>'.$diffContent.'</div>');
@ -169,26 +168,6 @@ class VersionFeed extends SiteTreeExtension
return null;
}
/**
* Compile a list of changes to the current page, excluding non-published and explicitly secured versions.
*
* @deprecated 2.0.0 Use VersionFeed::getDiffList() instead
*
* @param int $highestVersion Top version number to consider.
* @param boolean $fullHistory Set to true to get the full change history, set to false for a single diff.
* @param int $limit Limit to the amount of items returned.
*
* @returns ArrayList List of cleaned records.
*/
public function getDiffedChanges($highestVersion = null, $fullHistory = true, $limit = 100)
{
Deprecation::notice('2.0.0', 'Use VersionFeed::getDiffList() instead');
return $this->getDiffList(
$highestVersion,
$fullHistory ? $limit : 1
);
}
public function updateSettingsFields(FieldList $fields)
{
if (!$this->owner->config()->get('changes_enabled')) {

View File

@ -114,7 +114,6 @@ class VersionFeedController extends Extension
AND ("PublicHistory" IS NULL OR "PublicHistory" = \'1\')
ORDER BY "LastEdited" DESC LIMIT ' . $limit);
$lastChange = $latestChanges->record();
$latestChanges->rewind();
if ($lastChange) {
// Cache the diffs to remove DOS possibility.
@ -191,7 +190,6 @@ class VersionFeedController extends Extension
{
if (!Config::inst()->get(VersionFeed::class, 'allchanges_enabled')
|| !SiteConfig::current_site_config()->AllChangesEnabled
|| !method_exists($this->owner, 'getSiteRSSLink')
) {
return;
}