openscholar/openscholar — pull request #3837 by baisong (2013-09-17 19:40:03+00:00)
Title: account for when $gid returns no existing directive match #3382

#3382

Before this commit, in `vsite_update_7003()`, the update had logic like this:

```php
$directives) {
foreach ($directives as $gid => $directive) {
$results = db_query(/* Find all purl values that match this $gid */);
while ($record = $result->fetchAssoc()) {
/* Check that the purl value matches our current directive */
}
}
}
```

...but this didn't address a situation where there were:

* Erroneous mappings between `$gid` and purl.value, **AND**
* No purl value matching this `$gid`

So, this commit adds an `if { ... } else { ... }` to query for `$gid` off of the current directive's purl value, in such cases.