J2Store4 / j2store4

J2Store 4 - Open Source eCommerce extension for Joomla
https://www.j2store.org
GNU General Public License v3.0
16 stars 6 forks source link

Mail Template Error: 0 The Buttons variable should be an array of names of disabled buttons or boolean. #93

Closed ufuk-avcu closed 5 months ago

ufuk-avcu commented 6 months ago

This is a migrated J2Store Version from 3 to 4.0.4. Joomla Version 5.0.3.

Problem: If i try under J2Store > Design > Email templates > Change a Mail Templates, then this Problem occurs:

grafik

mgopin3 commented 6 months ago

@ufuk-avcu I understand your concern. Currently, we have not tested J2Store 4 compatibility with Joomla 5. Please rest assured that we appreciate your feedback, and we will take note of it. In the near future, we plan to migrate and conduct thorough testing to ensure J2Store 4 is compatible with Joomla 5. This update will be included in an upcoming J2Store release. Thank you for your patience and understanding.

JanosSz commented 6 months ago

Yes, I also encountered the problem. In the meantime, you could insert the following code in the document //libraries/src/Editor/AbstractEditorProvider.php after line44.

if (!\is_array($buttons) && !\is_bool($buttons)) { $buttons = []; }

However, you will have to insert it again after every Joomla update as long as J2Store has not fixed the error.

Joomla 5 has been out for a while and J2Store is in my opinion the easiest and simplest solution for a webshop. It would be a shame to miss the boat!!!

mgopin3 commented 6 months ago

@JanosSz Thank you for bringing this issue to our attention. We will take note of this issue and ensure compatibility of our J2Store 4.x.x component with Joomla 5. We are committed to resolving this issue in an upcoming release of J2Store.

ufuk-avcu commented 6 months ago

Hi. I tried it again with a Joomla 3 to Joomla 4 Migration and now this Problem appears: grafik

mgopin3 commented 6 months ago

@JanosSz After reviewing your error code, it appears that the issue is caused by not passing the required parameters inside the J2Html::custom() function. Typically, this function requires four parameters. Please double-check if you have written a template override for /administrator/components/com_j2store/layouts/edit/email_tab.php and ensure that you have provided all four required parameters as shown below: J2Html::custom($field['type'], $field['name'], $field['value'], $field['options']); The error is occurring at line 138 of email_tab.php. Kindly verify and update accordingly. If you need further assistance, please let us know.

JanosSz commented 6 months ago

Thanks Gopi for your reply!

The error code above was from ufuk-avcu, but yes, mine look almost exactly the same. I did not write a template override myself. The files are untouched as you have provided. Here is a screenshot of my error messages.

Bildschirmfoto 2024-03-20 um 17 32 13

The error occurs after clicking on the linked email subject when I want to view the existing email template.

Bildschirmfoto 2024-03-20 um 18 18 12

Or have I misunderstood something?

JanosSz commented 6 months ago

The line 138 looks exactly as you have described.

ufuk-avcu commented 6 months ago

Same like @JanosSz . No template Overrides regarding J2Store.

mgopin3 commented 6 months ago

@JanosSz I understand your concern, and I assure you that we are actively working to ensure compatibility between our J2Store 4.x.x component and Joomla 5. We are committed to resolving this issue in an upcoming release of J2Store. In the meantime, to address this issue, you can make changes to your /administrator/components/com_j2store/helpers/j2html.php file.

Please locate line number 880 in the j2html.php file and replace the existing code with the following: $options = isset($options['buttons']) && is_array($options['buttons']) ? $options['buttons'] : []; $editor = self::getEditor($editor_type); $html = $editor->display($name, $value, $width, $height, $cols, $rows, false, $id, null, null, $options);

By implementing this change, the issue should be resolved. For further guidance, you can refer to the video provided [video]

ufuk-avcu commented 6 months ago

@mgopin3 state now: J4.4, JStore 4 without overrides

I tried the two changes you provided and and i have the same errors:

grafik

mgopin3 commented 6 months ago

@JanosSz @ufuk-avcu We acknowledge your concern. At present, we have not conducted compatibility testing of J2Store 4 with Joomla 5. However, please be assured that your feedback is highly valued, and we will duly consider it.

In the coming time, we intend to initiate migration processes and undertake comprehensive testing to ensure seamless compatibility of J2Store 4 with Joomla 5. This endeavor will be incorporated into an upcoming release of J2Store.

We sincerely appreciate your patience and understanding as we work towards ensuring an optimal user experience.

ufuk-avcu commented 6 months ago

@JanosSz i wrote two times explicitly that this is the behaviour in J4.4.3. You can see the Joomla Version also in the Screenshot. It's not Joomla 5 anymore.

mgopin3 commented 6 months ago

@ufuk-avcu We have thoroughly reviewed our site and confirmed that the email template functionality is working flawlessly without any reported issues. Regrettably, we have been unable to reproduce the problem on our end. Therefore, we kindly suggest that you raise a ticket with the J2Store support team. Providing admin login details along with FTP access will allow us to further investigate and address the issue effectively from our end. Your cooperation in this matter is greatly appreciated.

JanosSz commented 6 months ago

@mgopin3

Please locate line number 880 in the j2html.php file and replace the existing code with the following: $options = isset($options['buttons']) && is_array($options['buttons']) ? $options['buttons'] : []; $editor = self::getEditor($editor_type); $html = $editor->display($name, $value, $width, $height, $cols, $rows, false, $id, null, null, $options);

Thank You! This worked fine! However, the error message: "Joomla\CMS\Filesystem\Folder::files: Path is not a folder" is still there. This is not an issue for me, just slightly distracting.

mgopin3 commented 6 months ago

@JanosSz Glad to hear that the email template issue has been resolved on your site. Regarding the error code "Joomla\CMS\Filesystem\Folder::files: Path is not a folder", we are unable to reproduce this issue on our site. Could you please share a video or provide step-by-step instructions on how to reproduce this issue that you are encountering?

ufuk-avcu commented 5 months ago

I have now found the issue. I changed the Backend Language from German to English for my User and now i can edit the Mail Templates like excepted!