-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(UpdateHandler): prepare to next doryphore release #1
base: doryphore
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
namespace YesWiki\Benevolat; | ||
|
||
use YesWiki\Core\YesWikiAction; | ||
|
||
class UpdateAction__ extends YesWikiAction | ||
{ | ||
public function run() | ||
{ | ||
if (!$this->isWikiHibernated() | ||
&& $this->wiki->UserIsAdmin() | ||
&& !empty($_GET['action']) | ||
&& $_GET['action'] === 'post_install' | ||
) { | ||
$version = $this->params->get('yeswiki_version'); | ||
if (!is_string($version)) { | ||
$version = ''; | ||
} | ||
$release = $this->params->get('yeswiki_release'); | ||
if (!is_string($release)) { | ||
$release = ''; | ||
} | ||
$matches = []; | ||
if ( | ||
$version !== 'doryphore' | ||
|| !preg_match("/^(\d+)\.(\d+)\.(\d+)\$/", $release, $matches) | ||
|| intval($matches[1]) > 4 | ||
|| ( | ||
intval($matches[1]) === 4 | ||
&& ( | ||
intval($matches[2]) > 4 | ||
|| ( | ||
intval($matches[2]) === 4 | ||
&& intval($matches[3]) > 4 | ||
) | ||
) | ||
) | ||
) { | ||
$anchor = '<span class="update-hint">' . _t('UPDATE_ADMIN_PAGES_HINT') . '</span><br />'; | ||
$this->output = str_replace( | ||
$anchor, | ||
<<<HTML | ||
$anchor | ||
<br/> | ||
{$this->wiki->render('@benevolat/update-handler.twig', [])} | ||
HTML, | ||
$this->output | ||
); | ||
} | ||
} | ||
} | ||
|
||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. il vaut mieux pas intervenir sur la page de post install, les migrations ont été créées pour etre lancées en fin d'install et maj, afin d'eviter des clics qui sont parfois oubliés par les usager.es et c'est pas forcement le bon endroit pour rajouter des boutons car tres peu visibles |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Peut être pas les supprimer avant ectoplasme, pour permettre d'installer sur des versions plus anciennes |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passer par un handler pour gérer la post-install est un peu "bancal" : si l'usagere ne lit pas la doc, elle ne connait pas l'existence de ce handler, et ne pourra pas finaliser la mise a jour de son yeswiki.
Je pense que ce serait mieux de ne pas permettre de choisir ses noms de pages, mais d'avoir une convention de nommage des pages ou on est presque surs que personne ne reprend ses nom et le les creer directement dans une migration.
(dans les versions futures de yeswiki on pourra sans doute reserver des routes comme pour les api)