Skip to content

Commit

Permalink
Merge pull request #172 from AlexanderBlanchardAC/DIS-92-Add_Feedback…
Browse files Browse the repository at this point in the history
…_When_Saving_Grapes_Page

refactor: Alter check to use active user
  • Loading branch information
AlexanderBlanchardAC authored Jan 17, 2025
2 parents e8445e1 + 9bb9c60 commit 87e2a82
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions code/web/services/WebBuilder/AJAX.php
Original file line number Diff line number Diff line change
Expand Up @@ -972,8 +972,10 @@ function trackWebResourceUsage() {
}
function saveAsTemplate(){
require_once ROOT_DIR . '/sys/WebBuilder/GrapesTemplate.php';

$activeUser = UserAccount::getActiveUserObj();

if (!UserAccount::isLoggedIn()) {
if (!$activeUser) {
return [
'success' => false,
'title' => translate([
Expand Down Expand Up @@ -1071,7 +1073,9 @@ function saveAsTemplate(){
function saveAsPage() {
require_once ROOT_DIR . '/sys/WebBuilder/GrapesPage.php';

if (!UserAccount::isLoggedIn()) {
$activeUser = UserAccount::getActiveUserObj();

if (!$activeUser) {
return [
'success' => false,
'title' => translate([
Expand Down

0 comments on commit 87e2a82

Please sign in to comment.