Skip to content

Commit

Permalink
Merge pull request #311 from GOCDB/release-5.7.6
Browse files Browse the repository at this point in the history
Release 5.7.6 to master
  • Loading branch information
gregcorbett authored Oct 27, 2021
2 parents 69c7e11 + 9d7aa88 commit c738aaa
Show file tree
Hide file tree
Showing 35 changed files with 51 additions and 33 deletions.
2 changes: 1 addition & 1 deletion htdocs/web_portal/static_html/goc5_logo.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!-- <img src="img/Logo-1.6.png" class="logo_image" height="39" style="vertical-align: middle;"/>-->
<h3 class="Logo_Text Small_Bottom_Margin Standard_Padding"
style="vertical-align: middle; margin-left: 0.2em;">
GOCDB 5.7.5
GOCDB 5.7.6
</h3>

</a>
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/entities/APIAuthentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
* @author George Ryall (github.com/GRyall)
*
* @Entity @Table(name="APIAuthenticationEntities",uniqueConstraints={@UniqueConstraint(name="siteIdentifier", columns={"parentSite_id", "type", "identifier"})})
* @Entity @Table(name="APIAuthenticationEntities", options={"collate"="utf8mb4_bin", "charset"="utf8mb4"}, uniqueConstraints={@UniqueConstraint(name="siteIdentifier", columns={"parentSite_id", "type", "identifier"})})
*/
class APIAuthentication
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/entities/ArchivedNGI.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*
* @author George Ryall
* @author David Meredith <david.meredith@stfc.ac.uk>
* @Entity @Table(name="ArchivedNGIs")
* @Entity @Table(name="ArchivedNGIs", options={"collate"="utf8mb4_bin", "charset"="utf8mb4"})
*/
class ArchivedNGI {

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/entities/ArchivedService.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*
* @author George Ryall
* @author David Meredith <david.meredith@stfc.ac.uk>
* @Entity @Table(name="ArchivedServices")
* @Entity @Table(name="ArchivedServices", options={"collate"="utf8mb4_bin", "charset"="utf8mb4"})
*/
class ArchivedService {

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/entities/ArchivedServiceGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*
* @author George Ryall
* @author David Meredith <david.meredith@stfc.ac.uk>
* @Entity @Table(name="ArchivedServiceGroups")
* @Entity @Table(name="ArchivedServiceGroups", options={"collate"="utf8mb4_bin", "charset"="utf8mb4"})
*/
class ArchivedServiceGroup {

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/entities/ArchivedSite.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
*
* @author George Ryall
* @author David Meredith <david.meredith@stfc.ac.uk>
* @Entity @Table(name="ArchivedSites")
* @Entity @Table(name="ArchivedSites", options={"collate"="utf8mb4_bin", "charset"="utf8mb4"})
*/
class ArchivedSite {

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/entities/CertificationStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @author John Casson
* @author David Meredith <david.meredith@stfc.ac.uk>
*
* @Entity @Table(name="CertificationStatuses")
* @Entity @Table(name="CertificationStatuses", options={"collate"="utf8mb4_bin", "charset"="utf8mb4"})
*/
class CertificationStatus {

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/entities/CertificationStatusLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* Site's certStatusLogs are also cascade deleted.
*
* @author David Meredith <david.meredith@stfc.ac.uk>
* @Entity @Table(name="CertificationStatusLogs")
* @Entity @Table(name="CertificationStatusLogs", options={"collate"="utf8mb4_bin", "charset"="utf8mb4"})
*/
class CertificationStatusLog {

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/entities/Country.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @author John Casson
* @author David Meredith <david.meredith@stfc.ac.uk>
*
* @Entity @Table(name="Countries")
* @Entity @Table(name="Countries", options={"collate"="utf8mb4_bin", "charset"="utf8mb4"})
*/
class Country {

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/entities/Downtime.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*
* @author David Meredith <david.meredithh@stfc.ac.uk>
* @author John Casson
* @Entity @Table(name="Downtimes")
* @Entity @Table(name="Downtimes", options={"collate"="utf8mb4_bin", "charset"="utf8mb4"})
*/
class Downtime {

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/entities/EndpointLocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* @author David Meredith <david.meredith@stfc.ac.uk>
* @author John Casson
*
* @Entity @Table(name="EndpointLocations")
* @Entity @Table(name="EndpointLocations", options={"collate"="utf8mb4_bin", "charset"="utf8mb4"})
*/
class EndpointLocation {

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/entities/EndpointProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*
* @author David Meredith <david.meredith@stfc.ac.uk>
*
* @Entity @Table(name="Endpoint_Properties", uniqueConstraints={@UniqueConstraint(name="endpointproperty_keypairs", columns={"parentEndpoint_id", "keyName"})})
* @Entity @Table(name="Endpoint_Properties", options={"collate"="utf8mb4_bin", "charset"="utf8mb4"}, uniqueConstraints={@UniqueConstraint(name="endpointproperty_keypairs", columns={"parentEndpoint_id", "keyName"})})
*/
class EndpointProperty {

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/entities/Infrastructure.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* @author John Casson
* @author David Meredith <david.meredith@stfc.ac.uk>
*
* @Entity @Table(name="Infrastructures")
* @Entity @Table(name="Infrastructures", options={"collate"="utf8mb4_bin", "charset"="utf8mb4"})
*/
class Infrastructure {

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/entities/NGI.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @author David Meredith <david.meredithh@stfc.ac.uk>
* @author John Casson
*
* @Entity @Table(name="NGIs")
* @Entity @Table(name="NGIs", options={"collate"="utf8mb4_bin", "charset"="utf8mb4"})
*/
class NGI extends OwnedEntity implements IScopedEntity {

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/entities/OwnedEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* @author David Meredith <david.meredithh@stfc.ac.uk>
* @author John Casson
*
* @Entity @Table(name="OwnedEntities")
* @Entity @Table(name="OwnedEntities", options={"collate"="utf8mb4_bin", "charset"="utf8mb4"})
* @InheritanceType("JOINED")
* @DiscriminatorColumn(name="discr", type="string")
* @DiscriminatorMap({"site" = "Site", "ngi" = "NGI", "project" = "Project",
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/entities/PrimaryKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*
* @author John Casson
*
* @Entity @Table(name="PrimaryKeys")
* @Entity @Table(name="PrimaryKeys", options={"collate"="utf8mb4_bin", "charset"="utf8mb4"})
*/
class PrimaryKey {

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/entities/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*
* @author David Meredith <david.meredith@stfc.ac.uk>
*
* @Entity @Table(name="Projects")
* @Entity @Table(name="Projects", options={"collate"="utf8mb4_bin", "charset"="utf8mb4"})
*/
class Project extends OwnedEntity {

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/entities/RetrieveAccountRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*
* @author John Casson
* @author David Meredith <david.meredith@stfc.ac.uk>
* @Entity @Table(name="RetrieveAccountRequests")
* @Entity @Table(name="RetrieveAccountRequests", options={"collate"="utf8mb4_bin", "charset"="utf8mb4"})
*/
class RetrieveAccountRequest {

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/entities/Role.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*
* @author David Meredith <david.meredithh@stfc.ac.uk>
* @author John Casson
* @Entity @Table(name="Roles", uniqueConstraints={@UniqueConstraint(name="NoDuplicateRoles", columns={"user_id", "roleType_id", "ownedEntity_id"})})
* @Entity @Table(name="Roles", options={"collate"="utf8mb4_bin", "charset"="utf8mb4"}, uniqueConstraints={@UniqueConstraint(name="NoDuplicateRoles", columns={"user_id", "roleType_id", "ownedEntity_id"})})
*
*/
class Role {
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/entities/RoleActionRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* Once created, object is immutable.
*
* @author David Meredith <david.meredith@stfc.ac.uk>
* @Entity @Table(name="RoleActionRecords")
* @Entity @Table(name="RoleActionRecords", options={"collate"="utf8mb4_bin", "charset"="utf8mb4"})
*/
class RoleActionRecord {

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/entities/RoleType.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* @author John Casson
* @author David Meredith <david.meredith@stfc.ac.uk>
*
* @Entity @Table(name="RoleTypes")
* @Entity @Table(name="RoleTypes", options={"collate"="utf8mb4_bin", "charset"="utf8mb4"})
*/
class RoleType {

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/entities/Scope.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* only linked to Scope instances).
*
* @author David Meredith <david.meredith@stfc.ac.uk>
* @Entity @Table(name="Scopes")
* @Entity @Table(name="Scopes", options={"collate"="utf8mb4_bin", "charset"="utf8mb4"})
*/
class Scope {

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/entities/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*
* @author David Meredith <david.meredithh@stfc.ac.uk>
* @author John Casson
* @Entity @Table(name="Services")
* @Entity @Table(name="Services", options={"collate"="utf8mb4_bin", "charset"="utf8mb4"})
*/
class Service implements IScopedEntity {

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/entities/ServiceGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* @author John Casson
* @author David Meredith <david.meredith@stfc.ac.uk>
*
* @Entity @Table(name="ServiceGroups")
* @Entity @Table(name="ServiceGroups", options={"collate"="utf8mb4_bin", "charset"="utf8mb4"})
*/
class ServiceGroup extends OwnedEntity implements IScopedEntity {

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/entities/ServiceGroupProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*
* @author James McCarthy
* @author David Meredith <david.meredith@stfc.ac.uk>
* @Entity @Table(name="ServiceGroup_Properties", uniqueConstraints={@UniqueConstraint(name="sgroup_keypairs", columns={"parentServiceGroup_id", "keyName"})})
* @Entity @Table(name="ServiceGroup_Properties", options={"collate"="utf8mb4_bin", "charset"="utf8mb4"}, uniqueConstraints={@UniqueConstraint(name="sgroup_keypairs", columns={"parentServiceGroup_id", "keyName"})})
*/
class ServiceGroupProperty {

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/entities/ServiceProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*
* @author James McCarthy
* @author David Meredith
* @Entity @Table(name="Service_Properties", uniqueConstraints={@UniqueConstraint(name="serv_keypairs", columns={"parentService_id", "keyName"})})
* @Entity @Table(name="Service_Properties", options={"collate"="utf8mb4_bin", "charset"="utf8mb4"}, uniqueConstraints={@UniqueConstraint(name="serv_keypairs", columns={"parentService_id", "keyName"})})
*/
class ServiceProperty {

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/entities/ServiceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @author John Casson
* @author David Meredith <david.meredith@stfc.ac.uk>
*
* @Entity @Table(name="ServiceTypes")
* @Entity @Table(name="ServiceTypes", options={"collate"="utf8mb4_bin", "charset"="utf8mb4"})
*/
class ServiceType {

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/entities/Site.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* @author John Casson
* @author David Meredith <david.meredith@stfc.ac.uk>
*
* @Entity @Table(name="Sites")
* @Entity @Table(name="Sites", options={"collate"="utf8mb4_bin", "charset"="utf8mb4"})
*/
class Site extends OwnedEntity implements IScopedEntity{

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/entities/SiteProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*
* @author James McCarthy
* @author David Meredith
* @Entity @Table(name="Site_Properties",uniqueConstraints={@UniqueConstraint(name="site_keypairs", columns={"parentSite_id", "keyName"})})
* @Entity @Table(name="Site_Properties", options={"collate"="utf8mb4_bin", "charset"="utf8mb4"}, uniqueConstraints={@UniqueConstraint(name="site_keypairs", columns={"parentSite_id", "keyName"})})
*/
class SiteProperty {

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/entities/SubGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/**
* @deprecated since version 5.4
* @author John Casson
* @Entity @Table(name="SubGrids")
* @Entity @Table(name="SubGrids", options={"collate"="utf8mb4_bin", "charset"="utf8mb4"})
*/
class SubGrid {

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/entities/Tier.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
/**
* @deprecated since version 5.4
* @author John Casson
* @Entity @Table(name="Tiers")
* @Entity @Table(name="Tiers", options={"collate"="utf8mb4_bin", "charset"="utf8mb4"})
*/
class Tier {

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/entities/Timezone.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Entities such as Sites should specify their timezone directly as attributes
* on the owning entity rather than joining to this entity.
* @deprecated since version 5.4
* @Entity @Table(name="Timezones")
* @Entity @Table(name="Timezones", options={"collate"="utf8mb4_bin", "charset"="utf8mb4"})
*/
class Timezone {

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/entities/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* @author John Casson
* @author David Meredith <david.meredith@stfc.ac.uk>
*
* @Entity @Table(name="Users", options={"collate"="utf8_bin"})
* @Entity @Table(name="Users", options={"collate"="utf8mb4_bin", "charset"="utf8mb4"})
*/
class User {

Expand Down
3 changes: 3 additions & 0 deletions lib/Gocdb_Services/Role.php
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,9 @@ public function addRole($roleTypeName, \User $user, \OwnedEntity $entity){
$roleType = $this->getRoleTypeByName($roleTypeName);
$r = new \Role($roleType, $user, $entity, $roleStatus);
$this->em->persist($r);

// Ensure roleId has been generated
$this->em->flush();

// create a RoleActionRecord after role has been persisted (to get id)
$rar = \RoleActionRecord::construct($user, $r, \RoleStatus::PENDING);
Expand Down
15 changes: 15 additions & 0 deletions lib/Gocdb_Services/Site.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ function editSite(\Site $site, $newValues, \User $user = null) {
throw new \Exception("Invalid scope update action");
}

// Replace lat/long with null if no value entered
$this->emptyStringToNull($newValues['Site']['LATITUDE']);
$this->emptyStringToNull($newValues['Site']['LONGITUDE']);

$this->em->getConnection()->beginTransaction();
try {
// Set the site's member variables
Expand Down Expand Up @@ -366,6 +370,13 @@ private function validate($site_data, $type) {
}
}

// Replaces empty string with null
private function emptyStringToNull(&$var) {
if ($var === '') {
$var = null;
}
}

/**
* Return all {@see \Site}s that satisfy the specfied filter parameters.
* <p>
Expand Down Expand Up @@ -728,6 +739,10 @@ public function addSite($values, \User $user =null) {
//check there are the required number of OPTIONAL scopes specified
$this->checkNumberOfScopes($values['Scope_ids']);

// Replace lat/long with null if no value entered
$this->emptyStringToNull($values['Site']['LATITUDE']);
$this->emptyStringToNull($values['Site']['LONGITUDE']);

// Populate the entity
try {
/* Create a PK for this site
Expand Down

0 comments on commit c738aaa

Please sign in to comment.