Go to System > Site Templates
Click Cassiopeia Details and Files
Edit a file
See PHP error log
PHP Notice: Trying to access array offset on value of type null in \administrator\components\com_templates\tmpl\template\default_modal_resize_body.php on line 25
PHP Notice: Trying to access array offset on value of type null in\administrator\components\com_templates\tmpl\template\default_modal_resize_body.php on line 35
Labels |
Added:
?
|
It could be related to PHP 7.4.1.
Ah that makes sense, I didn't test with 7.4, only with 7.3 and 7.2.
But the only array elements I see are $this->image['height']
and $this->image['width']
. Could you add some code to dump variable type of $this->image
into the log file and check what happens? I'd like to know if it's maybe an object instead of an array. Something like error_log(gettype($this->image))
?
I have 7.4 only on a test domain in web, not locally, so it would be a bit uncomfortable for me to install latest 4.0-dev and test. Would have to clean it up before.
$this->image
is null. You can install the nightly build.
That PHP file is not really well documented.
Tested on 7.3.14 with no errors. Here is the generated code without height/width values. Maybe remove the placeholder attribute?
<input class="form-control" type="number" name="height" placeholder=" px" required>
<input class="form-control" type="number" name="width" placeholder=" px" required>
I don't know why the following code is on that page and how to trigger the modal.
<form action="/administrator/index.php?option=com_templates&task=template.resizeImage&id=204&file=L2luZGV4LnBocA" method="post">
<div id="resizeModal" role="dialog" tabindex="-1" class="joomla-modal modal fade" >
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h3 class="modal-title">Resize Image</h3>
<button type="button" class="close novalidate" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<div id="template-manager-resize" class="container-fluid">
<div class="mt-2">
<div class="col-md-12">
<div class="control-group">
<div class="control-label">
<label for="height">
Height </label>
</div>
<div class="controls">
<input class="form-control" type="number" name="height" placeholder=" px" required>
</div>
</div>
<div class="control-group">
<div class="control-label">
<label for="width">
Width </label>
</div>
<div class="controls">
<input class="form-control" type="number" name="width" placeholder=" px" required>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Resize</button>
</div>
Go to images > system >
Click on an image to get crop and resize buttons.
Are you using PHP 7.4+? I think I have a fix. There is a logic to enable the resize modal for image type which it is not doing right now.
PHP 7.2.
I still think it is a PHP 7.4+ issue. I don't get the error with PHP 7.3.14
And where shall these bloody buttons appear? Maybe I'm just too silly to find them? You have a screenshot?
aah i have them, was blind, now can see.
I don't have the issue with 7.2 so yes, it could be a 7.4+ issue.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-02-07 22:19:55 |
Closed_By | ⇒ | Quy |
@Quy When I was reproducing issue #27832 , I did exactly the same what you describe in your steps to reproduce the issue here, but I did not have these entries in PHP error log. And I had error reporting switched to "Development" before. Does that happen with any file you edit? Or only particular?