1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 14:00:56 +01:00

Don't mark URL in creating macro as required

Test Plan: /macro/create/

Reviewers: mattrobenolt, epriestley

Reviewed By: epriestley

CC: aran, epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D5405
This commit is contained in:
Jakub Vrana 2013-04-06 11:47:47 -07:00
parent 338851ac54
commit fa41a3d6c6

View file

@ -33,7 +33,7 @@ final class PhabricatorMacroEditController
$errors = array();
$e_name = true;
$e_file = true;
$e_file = pht('Provide a URL or a file');
$file = null;
$can_fetch = PhabricatorEnv::getEnvConfig('security.allow-outbound-http');
@ -97,7 +97,6 @@ final class PhabricatorMacroEditController
if (!$macro->getID() && !$file) {
$errors[] = pht('You must upload an image to create a macro.');
$e_file = pht('Required');
}
if (!$errors) {
@ -191,14 +190,14 @@ final class PhabricatorMacroEditController
->setLabel(pht('URL'))
->setName('url')
->setValue($request->getStr('url'))
->setError($e_file));
->setError($request->getFileExists('file') ? false : $e_file));
}
$form->appendChild(
id(new AphrontFormFileControl())
->setLabel($other_label)
->setName('file')
->setError($e_file));
->setError($request->getStr('url') ? false : $e_file));
}