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

Unable to Add Attachments or Notes After Upgrade #782

Open
LibraryIT opened this issue Nov 12, 2024 · 3 comments
Open

Unable to Add Attachments or Notes After Upgrade #782

LibraryIT opened this issue Nov 12, 2024 · 3 comments
Labels
bug This is a bug (not an enhancement) Next release Propose for February release Regression Issue that surfaced related to latest release

Comments

@LibraryIT
Copy link

Earlier today we upgraded our CORAL installation from 2020.02 to the latest version. Now we can't seem to add attachments or notes in the resources module. When we click on the green "plus" icon nothing happens except a small note saying "JavaScript void" in the lower left-hand corner of the screen. The web server error logs have some lines which say

[Tue Nov 12 16:17:24.555781 2024] [php7:notice] [pid 15270] [client 141.222.46.117:57184] PHP Notice:  Undefined variable:
resourceNote in /www/coral/resources/ajax_htmldata/getProductDetails.php on line 439, referer: http://lib-web02.skidmore.ed
u/coral/resources/resource.php?resourceID=546
[Tue Nov 12 16:17:24.555801 2024] [php7:notice] [pid 15270] [client 141.222.46.117:57184] PHP Notice:  Trying to access arr
ay offset on value of type null in /www/coral/resources/ajax_htmldata/getProductDetails.php on line 439, referer: http://li
b-web02.skidmore.edu/coral/resources/resource.php?resourceID=546
[Tue Nov 12 16:17:24.556926 2024] [php7:notice] [pid 15276] [client 141.222.46.117:57185] PHP Notice:  Undefined variable:
resourceNote in /www/coral/resources/ajax_htmldata/getProductDetails.php on line 439, referer: http://lib-web02.skidmore.ed
u/coral/resources/resource.php?resourceID=546
[Tue Nov 12 16:17:24.556942 2024] [php7:notice] [pid 15276] [client 141.222.46.117:57185] PHP Notice:  Trying to access arr
ay offset on value of type null in /www/coral/resources/ajax_htmldata/getProductDetails.php on line 439, referer: http://li
b-web02.skidmore.edu/coral/resources/resource.php?resourceID=546

Can anyone point us in the direction of what is going wrong?

If it helps the upgrade process was not smooth and I had to attempt it multiple times. The first I accidentally overwrote the database. On the second I copied the admin configuration.ini files and was able to see the option to "upgrade/repair". However the installer threw numerous SQL errors from the file(s) in /install/protected. After reverting back to the old version, I re-ran the installer, but used the advanced settings to set the database names to be what they are in the database. So I essentially did a fresh install with the existing data.

@streatim
Copy link
Collaborator

streatim commented Nov 12, 2024

Greetings @LibraryIT -

I've been trying to replicate the issue on my local copy of 2024.10 and am struggling to do so for, at least, the Notes field. The issue described in the error logs is definitely in the 2024.10 code - line 439 is trying to echo $resourceNote['resourceNoteID'] but $resourceNote isn't defined until 445 (and this particular javascript call looks like a copy-paste of 449, which would explain why it's using the undefined variable). I see in the web logs you shared there's a line that says "php7" but, by chance, are you running PHP 8+? I believe 8+ was a lot more unforgiving with undefined variables and that might explain the discrepancy between what I see and you see (I'm on 7.4.33) and would point to a potentially very quick solution, which would be to just remove the empty echo statement from 439.

With regards to adding attachments, I did run into a brief issue where I needed to check the write permissions for /coral/resources/attachments/ - in the process of my own upgrade the attachments directory wasn't set to include write access, so I wasn't able to upload any file. Are the write permissions for your directory set up to allow write access?

@streatim streatim added the bug This is a bug (not an enhancement) label Nov 12, 2024
@LibraryIT
Copy link
Author

Unfortunately we are on the same version of PHP as you are. Commenting out the line in question seemed to do the trick. Granted I only briefly tested on one record, but the add attachment and add note modal windows did pop up. Thank you for providing a quick workaround.

@streatim
Copy link
Collaborator

Glad to hear the workaround worked! I'm going to flag this Issue to get formally fixed in the next release, so we'll keep the issue open until then.

@streatim streatim added the Next release Propose for February release label Nov 13, 2024
@j-weston j-weston added the Regression Issue that surfaced related to latest release label Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This is a bug (not an enhancement) Next release Propose for February release Regression Issue that surfaced related to latest release
Projects
None yet
Development

No branches or pull requests

3 participants