Commit ab1d952d authored by Côme Chilliet's avatar Côme Chilliet

Merge branch '6076-fatal-error-when-applying-template-with-no-asked-fields' into '1.4-dev'

Resolve "Fatal error when applying template with no asked fields"

See merge request fusiondirectory/fd!746
parents 1f6bb5fc fa3404c9
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2014-2016 FusionDirectory
Copyright (C) 2014-2020 FusionDirectory
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -129,7 +129,7 @@ class template
}
}
function getNeeded ()
function getNeeded (): array
{
return $this->attributes;
}
......
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2013-2019 FusionDirectory
Copyright (C) 2013-2020 FusionDirectory
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -56,8 +56,9 @@ class templateDialog
}
if (($this->target === NULL) &&
(isset($_POST[$this->post_finish]) || isset($_GET[$this->post_finish])) &&
is_object($this->template)) {
is_object($this->template) &&
(isset($_POST[$this->post_finish]) || isset($_GET[$this->post_finish]) || empty($this->template->getNeeded()))
) {
$this->template->save_object();
return $this->handle_finish();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment