File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -392,11 +392,28 @@ public function invokeInstall()
392392 return $ this ->redirect ('/ ' );
393393 }
394394
395+ $ force = $ queryParams ['force ' ] ?? '' ;
396+ $ force = $ force === 'true ' ? true : false ;
397+
398+
395399 try {
396- $ this ->moduleInstaller ->installWithDependencies ($ module );
400+ if ($ force ) {
401+ $ this ->moduleInstaller ->install ($ module , true );
402+ } else {
403+ $ this ->moduleInstaller ->installWithDependencies ($ module );
404+ }
397405 } catch (DependencyException $ e ) {
406+ $ foreInstallUrl = "?action=install "
407+ . "&archiveName= {$ module ->getArchiveName ()}"
408+ . "&version= {$ module ->getVersion ()}"
409+ . "&ref=moduleInfo "
410+ . "&force=true " ;
411+
398412 Notification::pushFlashMessage ([
399- 'text ' => $ e ->getMessage (),
413+ 'text ' => $ e ->getMessage ()
414+ . '<br><br>Click here to <a href=" ' . $ foreInstallUrl . '"> '
415+ . 'force install ' . $ module ->getArchiveName () . ': ' . $ module ->getVersion ()
416+ . ' without dependencies.</a> ' ,
400417 'type ' => 'error '
401418 ]);
402419 } catch (RuntimeException $ e ) {
You can’t perform that action at this time.
0 commit comments