eworkers / K2ForJ4

GNU General Public License v2.0
11 stars 6 forks source link

Attachments & Images cannot be saved for K2 items #38

Closed tdrugan closed 10 months ago

tdrugan commented 10 months ago

In Joomla 4.4.0 (runnning on Debian 11 with Apache) using both JCE or TinyMCE I cannot attach any file to an item. Using image or attachments: When I try to load an image to a K2 Item I get: image but putting an image to a Categoriry runs well.

When I try to save an attachment to a K2 Item I get: image or: image but all previous attachments are visible and can be deleted but cannot be reattached to the item.

I have attached the some logs: logs.zip

eworkers commented 10 months ago

When I try to save an attachment to a K2 Item I get:

most likely a permission issue, maybe you have copied or moved your project files and some permission conflicts might have occurred, please first check that '[YOUR BASE ROOT]/media/k2/assets/vendors/verot/class.upload.php/src/class.upload.php' in fact exists, if so please check that media folders and sub folders have CHMOD 755 and files have CHMOD 644 and report again.

for the "checked_out_time" default value issue, we can investigate this after dealing with the above issue.

tdrugan commented 10 months ago

Thank you for answer.

The /media/k2/assets/vendors/verot/class.upload.php/src/class.upload.php' exists and it is the same as in your archive.

I have replaced folders and files wrights with 755 and 644 as indicated. Now I can save an image for an existing K2 item but I cannot save an attachment. If I attach something I get: [image: image.png]

but nothing is attached.

If I try creating a new item I get the "checked_out_time"warning and the new item it is not saved.

I am working on a clone of my main system so no other user is on my site now. The attached log is produced in severel minutes and correspond to my actions: attach a file to an existing item and trying to create a new one. A lot of the errors/warnings are related to the fact that I have a three language site.

Thank you for your envolvement, I do what I can because I am only an amateur (with no formal IT training) trying to keep my university department server alive.

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Fără viruși.www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Tue, Nov 14, 2023 at 12:24 PM eworkers @.***> wrote:

When I try to save an attachment to a K2 Item I get:

most likely a permission issue, maybe you have copied or moved your project files and some permission conflicts might have occurred, please first check that '[YOUR BASE ROOT]/media/k2/assets/vendors/verot/class.upload.php/src/class.upload.php' in fact exists, if so please check that media folders and sub folders have CHMOD 755 and files have CHMOD 644 and report again.

for the "checked_out_time" default value issue, we can investigate this after dealing with the above issue.

— Reply to this email directly, view it on GitHub https://github.com/eworkers/K2ForJ4/issues/38#issuecomment-1809930856, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACNLAZKR4QUMFMOUDODX6HLYENBELAVCNFSM6AAAAAA7KKH4U2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBZHEZTAOBVGY . You are receiving this because you authored the thread.Message ID: @.***>

-- Tudor C DRUGAN

eworkers commented 10 months ago

Make sure you the media folder is writable, if you specified a custom path for k2 attachments make sure it is writable as well, the default k2 attachments path is YOURROOT/media/k2/attachments

the warning might be related to your outdated k2 sql schema, or maybe you didn't export/import your sql properly Try to execute the following sql using phpmyadmin or any other method:

ALTER TABLE `YOURTABLEPREFIX_k2_items` 
CHANGE `created` `created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
CHANGE `checked_out_time` `checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
CHANGE `modified` `modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
CHANGE `publish_up` `publish_up` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
CHANGE `publish_down` `publish_down` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00';
ALTER TABLE `YOURTABLEPREFIX_k2_comments` 
CHANGE `commentDate` `commentDate` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00';

don't forget to change YOURTABLEPREFIX with your real prefix before executing the sql code, and please report back

tdrugan commented 10 months ago

Done. Now I can create a new K2 item and attach images to it. One step forward was done.

But still I cannot add attachments even if I thing the rights are ok:

[image: att.jpg] For those tables maybe the backup/restore it is not done in a correct way when I clone the site and database, but on J3.10 there were no issues.

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Fără viruși.www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Wed, Nov 15, 2023 at 6:27 PM eworkers @.***> wrote:

Make sure you the media folder is writable, if you specified a custom path for k2 attachments make sure it is writable as well, the default k2 attachments path is YOURROOT/media/k2/attachments

the warning might be related to your outdated k2 sql schema, or maybe you didn't export/import your sql properly Try to execute the following sql using phpmyadmin or any other method:

ALTER TABLE YOURTABLEPREFIX_k2_items CHANGE created created DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', CHANGE checked_out_time checked_out_time DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', CHANGE modified modified DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', CHANGE publish_up publish_up DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', CHANGE publish_down publish_down DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00';

ALTER TABLE YOURTABLEPREFIX_k2_comments CHANGE commentDate commentDate DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00';

don't forget to change YOURTABLEPREFIX with your real prefix before executing the sql code, and please report back

— Reply to this email directly, view it on GitHub https://github.com/eworkers/K2ForJ4/issues/38#issuecomment-1812861915, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACNLAZM6MQ5PWH6XIQGPRN3YETUQPAVCNFSM6AAAAAA7KKH4U2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJSHA3DCOJRGU . You are receiving this because you authored the thread.Message ID: @.***>

-- Tudor C DRUGAN

eworkers commented 10 months ago

[image: att.jpg]

Can you please explain where are you seeing this? this does not seem a k2 issue, however to help you we need more insights. Is it ok for you to provide a temp backend user with privileges to add k2 items? if not please try to inspect your browser on save and check save response and share it.

but before you do so you can try the following if you have shell access to you server:

find /path/to/base/dir/media/k2 -type d -print0 | xargs -0 chmod 755
find /path/to/base/dir/media/k2 -type f -print0 | xargs -0 chmod 644

in case sudo is needed:

find /path/to/base/dir/media/k2 -type d -print0 | sudo xargs -0 chmod 755
find /path/to/base/dir/media/k2 -type f -print0 | sudo xargs -0 chmod 644
tdrugan commented 10 months ago

Done but with no succes, cannot add any attachment.

What kind of access do you need on the Joomla site or on the Debian server? Or both?

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Virus-free.www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Thu, Nov 16, 2023 at 12:20 PM eworkers @.***> wrote:

[image: att.jpg]

Can you please explain where are you seeing this? this does not seem a k2 issue, however to help you we need more insights. Is it ok for you to provide a temp backend user with privileges to add k2 items? if not please try to inspect your browser on save and check save response and share it.

but before you do so you can try the following if you have shell access to you server:

find /path/to/base/dir/media/k2 -type d -print0 | xargs -0 chmod 755 find /path/to/base/dir/media/k2 -type f -print0 | xargs -0 chmod 644

in case sudo is needed:

find /path/to/base/dir/media/k2 -type d -print0 | sudo xargs -0 chmod 755 find /path/to/base/dir/media/k2 -type f -print0 | sudo xargs -0 chmod 644

— Reply to this email directly, view it on GitHub https://github.com/eworkers/K2ForJ4/issues/38#issuecomment-1814159333, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACNLAZJIQT4Y6FC3JNWNF53YEXSF3AVCNFSM6AAAAAA7KKH4U2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJUGE2TSMZTGM . You are receiving this because you authored the thread.Message ID: @.***>

-- Tudor C DRUGAN

eworkers commented 10 months ago

is your website public or in dev mode? if it is in dev mode you can share with us a credentials for a joomla admin account with limited privileges as long as it is capable to create a k2 item and maybe we can detect the issue you are facing and then you can delete the account after that

eworkers commented 10 months ago

closing this reason: issue from the user side, outdated/broken sql schema for attachments table

solved by correcting the schema:

ALTER TABLE `PREFIX_k2_attachments`
CHANGE `itemID` `itemID` INT(11) NOT NULL DEFAULT '0',
CHANGE `hits` `hits` INT(11) NOT NULL DEFAULT '0',
CHANGE `filename` `filename` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
CHANGE `title` `title` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
CHANGE `titleAttribute` `titleAttribute` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '';