Hi Master,I want to ask about the prefix on the view tag,vieworderlist?id_order={$this->urlEncode($this->id_order->CurrentValue)}&id=previously my code ran well, but after I updated the template I encountered an error like this,ErrorException (E_DEPRECATED)
urlencode(): Passing null to parameter #1 ($string) of type string is deprecatedcan anyone tell me if there is a code change that I don’t know about?
PHP 8 does not allow passing null to urlencode, you should check if $this->id_order->CurrentValue has value first.
how to check whether it has value or not?
where do i put this code?
if (!empty($this->id_order->CurrentValue )
If your prefix cannot be written as inline code, you better use Row_Rendered server event to set the HrefValue property of the field.
i use this code still not working
any suggestions?
if (!empty($this->id_barang->CurrentValue)) {
$this->id_order->HrefValue = "vieworderlist?id_order={". $this->urlEncode($this->id_order->CurrentValue) ."}&id=";
}
In server event you don’t need “{” and “}” anymore, those are for PHP string variable parsing only.
thank you, it’s working