1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-14 02:34:24 +02:00

A couple of minor adjustments

This commit is contained in:
Ryan Cramer
2019-05-17 13:26:38 -04:00
parent bac9736e49
commit f1d5f12835
2 changed files with 8 additions and 5 deletions

View File

@@ -1007,6 +1007,10 @@ class WireDatabaseBackup {
protected function restorePDO($filename, array $options = array()) {
$fp = fopen($filename, "rb");
if($fp === false) {
$this->error("Unable to open: $filename");
return false;
}
$numInserts = 0;
$numTables = 0;
$numQueries = 0;

View File

@@ -63,10 +63,9 @@ class InputfieldSelect extends Inputfield {
* If you want to add an optgroup, use the $value param as the label, and the label param as an array of options.
* Note that optgroups may not be applicable to other Inputfields that descend from InputfieldSelect.
*
* @param string $value Value that the option submits
* @param string $label|array Optional label associated with the value (if null, value will be used as the label)
* @param array $attributes Optional attributes to be associated with this option (i.e. a 'selected' attribute for
* an <option> tag)
* @param string $value Value that the option submits (or label of optgroup, if specifying an optgroup)
* @param string $label|array Optional label associated with the value (if null, value will be used as the label), or array of optgroup options [value=>label]
* @param array $attributes Optional attributes to be associated with this option (i.e. a 'selected' attribute for an <option> tag)
* @return $this
*
*/
@@ -315,7 +314,7 @@ class InputfieldSelect extends Inputfield {
public function isOptionSelected($value) {
$valueAttr = $this->attr('value');
if(empty($valueAttr)) {
if($this->isEmpty()) {
// no value set yet, check if it's set in any of the option attributes
$selected = false;
if(isset($this->optionAttributes[$value])) {