Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Attachments and Tags not added in database #62

Closed
martyharty opened this issue Mar 4, 2024 · 12 comments
Closed

New Attachments and Tags not added in database #62

martyharty opened this issue Mar 4, 2024 · 12 comments

Comments

@martyharty
Copy link

martyharty commented Mar 4, 2024

Uploading a pdf to an existing item is uploaded to the media folder, but not added to the database and not attached the item. Maybe this behaviour is just on my side, but the rest of item editing seems to work fine on front- and backend. I did change the item model getname() with basename() and there is a JavaScript error: cannot read properties of undefined (reading 'msie'). Not sure if this affects the addAttachment to database function.

Unfortunately the same behaviour on my other upgrade; file is uploaded, but not inserted into db.

@martyharty
Copy link
Author

New tags are also not saved to the item or database. On both sites J4/PHP 8.1 and database schemes are up to date (different servers). Could it be someting with count() or store()?

Also the extra field radio buttons are stacked/ displayed inline.

@martyharty martyharty changed the title Attachment not added in database New Attachments and Tags not added in database Mar 6, 2024
@cmirnow
Copy link

cmirnow commented Mar 6, 2024

I can't reproduce the problem. I tried adding a tag and an attachment to a K2 article on a test site, and I have no problem with it.

Perhaps this is a local problem? I think this issue has already been resolved.

@martyharty
Copy link
Author

Thanks for your reaction. I have the same problem in two different environments without any errors... I will be pulling my hair a little longer.

Is it possible to install the package over the existing one and/ or use it on a fresh J4 install? I will test further

@cmirnow
Copy link

cmirnow commented Mar 7, 2024

Is it possible to install the package over the existing one and/ or use it on a fresh J4 install? I will test further

I think it is enough to install the new revision of K2ForJ4 over of the old release.

Perhaps these two fixed bugs are similar to your problem? -
#38
#43

Can you provide technical information about your database server? What database encoding is used? The two servers I use do not have the problem you describe.

@martyharty
Copy link
Author

With latest revision installed, first tried the attachment:
Call to undefined method Joomla\CMS\Filesystem\File::getName()

In com_k2/models/item.php
//$existingFileName = File::getName($dest) ;deprecated
$existingFileName = basename($dest);

Upload is working: files move to media/k2/attachments

Added tag via menu: "Field description doesn't have a value"
Alter #__k2_tags description to a NULL value saves the tag and also the item saving works.

Then I finally found the conflicting ordering row in the attachments table from this old fix (on both sites):
getk2/k2#511 (maybe later)

Database Version 10.11.6-MariaDB-log
Database Collation latin1_swedish_ci

Database Version 10.5.24-MariaDB
Database Collation latin1_swedish_ci

For now it works. Thanks!

@eworkers
Copy link
Owner

Added tag via menu: "Field description doesn't have a value" Alter #__k2_tags description to a NULL value saves the tag and also the item saving works.

But k2_tags does not have a description column! do you have a customized K2 version that you tried to update from?

@martyharty
Copy link
Author

Not that I am aware of. Please check the latest K2 install: https://github.com/getk2/k2/blob/7ec1dbdb1283fb6134a1ed83c0886e3fd8e253db/install.k2.php#L181C5-L187C6

@eworkers
Copy link
Owner

Apparently k2 official version added description feature for tags which this fork do not support for the moment, update is on the way

@eworkers
Copy link
Owner

please update and check if your issue remains. If latest update fixes your issue, please close this

@cmirnow
Copy link

cmirnow commented Mar 23, 2024

added tag description, (k2 introduced new feature that might have cau…)

@eworkers, is this update safe for those users who upgraded from K2 to K2forJ4 before the official K2 had this field?

@martyharty
Copy link
Author

Works for me. Also changed back tags db. I guess with new migrations better not use the latest K2. Thanks

cmirnow referenced this issue Mar 25, 2024
…imum K2 rollup release to prevent conflicts that can be caused by new features.)
@eworkers
Copy link
Owner

added tag description, (k2 introduced new feature that might have cau…)

@eworkers, is this update safe for those users who upgraded from K2 to K2forJ4 before the official K2 had this field?

Yes of course

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants