23 private readonly
Article $article,
24 private readonly
bool $ignoreWarning,
25 private readonly
int $oldId,
26 private readonly
string $section,
27 private readonly
Title $title,
28 private readonly
User $user,
29 private readonly ?
MessageValue $warningMessageWrapper =
null,
37 if ( $this->section ===
'new' ) {
41 $revRecord = $this->article->fetchRevisionRecord();
43 if ( !$revRecord->userCan( RevisionRecord::DELETED_TEXT, $this->user ) ) {
45 ->setValue( self::AS_REVISION_WAS_DELETED );
46 } elseif ( $revRecord->isDeleted( RevisionRecord::DELETED_TEXT ) ) {
49 $warningMessage = MessageValue::new(
50 'rev-deleted-text-view',
51 [ $this->title->getPrefixedURL() ]
54 if ( $this->warningMessageWrapper !==
null ) {
55 $warningMessage = $this->warningMessageWrapper->params( $warningMessage );
57 return $status->warning( $warningMessage )->setOK( $this->ignoreWarning );
59 } elseif ( $this->title->exists() ) {
62 ->setValue( self::AS_REVISION_MISSING );
if(!defined('MW_SETUP_CALLBACK'))
Abstract class for all constraints that can prevent edits.
This constraint is used to display an error if the user loses access to the revision while editing it...
checkConstraint()
EditPageStatus A status indicating failure or success. A status that is not OK indicates a failure an...
__construct(private readonly Article $article, private readonly bool $ignoreWarning, private readonly int $oldId, private readonly string $section, private readonly Title $title, private readonly User $user, private readonly ?MessageValue $warningMessageWrapper=null,)
Status returned by edit constraints and other page editing checks.
Legacy class representing an editable page and handling UI for some page actions.
static newFatal( $message,... $parameters)
Factory function for fatal errors.
static newGood( $value=null)
Factory function for good results.