• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved Basic Form Submission returns Internal Error

JaXnPriVate

New Pleskian
Server operating system version
Ubuntu
Plesk version and microupdate number
18.0.49
I implemented a simple Form (Copy and Pasted it from both Documentation Pages),

but both returned an Internal Error for me.

Do I have to give my method a certain name?

1678030045530.png

PHP:
public function formAction(){
$this->registerTabs();
$formIO = DomainHandler::createAddForm();

// Assign Form to View.
$this->view->settings = $formIO;

// Check for Form Submit.
if ($this->getRequest()->isPost()) {

// Proccess/save value here

$this->_status->addInfo('Data was successfully saved.');
//$this->_helper->json(['redirect' => pm_Context::getBaseUrl()]);
}
}
 
We need a little more context. Can you post the link to the documentation where you found the code?
 
instantiation
Do you mean "Initialization" ? When you mean OOP, i not extended my Form as Form Simple.

I will not use the extended Class before it not works.


Following Code i used to build the Form Object:

PHP:
/** * Create new Form for Add DynDNS Domain.
* @return void
*
* // Domain
* // Username || Password
* // Type (IPv4 || IPv6 || Both)...
*/
public function createAddForm()
{
// Create new Zend Form.
$formIO = new pm_Form_Simple();

// Get Domains for Customer via ID.
$domainsIO = self::getDomains(pm_Session::getClient()->getId());

// Add Sub-Domain Field.
$formIO->addElement("text", "ddns-subdomain", [
"label" => "Subdomain",
"value" => "DynDNS",
'class' => 'f-middle-size',
'validators' => [
['StringLength', true, [0, 255]],
],
"required" => true
]);

// Add Description for Sub-Domain.
$formIO->addElement('description', 'ddns-wildcard', [
"description" => "Sie müssen nicht zwingend eine Subdomain verwenden, nutzen sie <b>'@' um ein Wildcard</b> Record für DynDNS zu erstellen.",
"escape" => false
]);

// Check if Domains Array not empty.
if (sizeof($domainsIO) != 0) {
// Add Domain Selector.
$formIO->addElement("select", "ddns-domain", [
"label" => "Domain",
"multiOptions" => $domainsIO,
"required" => true
]);
}

// Add Type Selector.
$formIO->addElement("select", "ddns-type", [
"label" => "Domain",
"multiOptions" => [
"IPv4 Adresse", "IPv6 Adresse", "IPv4- und IPv6 Adresse", "IPv4 Adresse und IPv6 Präfix", "IPv6 Präfix"
],
"required" => true
]);


// Add Description TextArea.
$formIO->addElement("textarea", "ddns-description", [
"label" => "Beschreibung",
"value" => "Platzhalter Beschreibung",
"rows" => "4",
'class' => 'f-middle-size',
'validators' => [
['StringLength', true, [0, 255]],
],
"required" => false
]);

// Add Form Actions.
$formIO->addControlButtons([
"cancelLink" => pm_Context::getActionUrl("index", "overview")
]);

return $formIO;
}
 
Is there any other Error Log for Plesk Zend Framework?

/var/log/plesk/panel.log <-- Does not print anything when i submit the Form.
 
I found the bug, it's because of the hyphens in the names of the objects / DOM elements.

Plesk deletes them, but apparently not from the backend, where they remain.

If I write everything without hyphens, it goes 1A, I find kind of stupid but is so.

I do not know if this is a known issue,
there was nothing in the docs and the error log was also not meaningful.
 
Back
Top