Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX : Blank page when resource has been created #509

Open
wants to merge 1 commit into
base: 17.0_koesio
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions htdocs/resource/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,18 @@
}

if (empty($reshook)) {
if ($cancel) {
if (!empty($backtopage)) {
header("Location: ".$backtopage);
exit;
}
if ($action == 'add') {
header("Location: ".DOL_URL_ROOT.'/resource/list.php');
exit;
$error = 0;

$backurlforlist = dol_buildpath('/resource/list.php', 1);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tu peux pas le mettre en camelCase ?


if (empty($backtopage) || ($cancel && empty($id))) {
if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
$backtopage = $backurlforlist;
} else {
$backtopage = dol_buildpath('/resource/card.php', 1).'?id='.((!empty($id) && $id > 0) ? $id : '__ID__');
}
}
$action = '';
}

include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
Expand Down Expand Up @@ -118,8 +120,11 @@
}

// Create/Edit object

print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$id.'" method="POST">';
if($action == 'create') {
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
} elseif ($action == 'edit') {
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$id.'" method="POST">';
}
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="'.($action == "create" ? "add" : "update").'">';

Expand Down
Loading