- // Check for active editing or time conflict
- $warnings = [];
- $jsonResponseWarning = '';
- $editActivity = new PageEditActivity($page);
- if ($editActivity->hasActiveEditing()) {
- $warnings[] = $editActivity->activeEditingMessage();
- }
- $userDraft = $this->pageRepo->getUserDraft($page);
- if ($userDraft !== null) {
- if ($editActivity->hasPageBeenUpdatedSinceDraftSaved($userDraft)) {
- $warnings[] = $editActivity->getEditingActiveDraftMessage($userDraft);
- }
- }
- if (count($warnings) > 0) {
- $jsonResponseWarning = implode("\n", $warnings);
- }
-