Skip to content

Commit

Permalink
Merge pull request #4001 from ExpressionEngine/bug/7.x/entry-ip-addre…
Browse files Browse the repository at this point in the history
…ss-validation

Resolved #3998 where no proper error was shown when trying to clone entry with an invalid IP address
  • Loading branch information
intoeetive committed Feb 22, 2024
2 parents bf9b568 + 8b17784 commit 2ad34e4
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,13 @@ protected function validateEntry(ChannelEntry $entry, $layout)
->withTitle(lang($action . '_entry_error'))
->addToBody(lang($action . '_entry_error_desc'))
->now();
// IP Address is not a field, but we need to display the error if it fails
if ($result->hasErrors('ip_address')) {
ee('CP/Alert')->makeInline('ip_address-error')
->asIssue()
->addToBody('ip_address: ' . implode(BR, $result->getErrors('ip_address')))
->now();
}
}

return $result;
Expand Down

0 comments on commit 2ad34e4

Please sign in to comment.