PoeticMediaLab / Lacuna

Lacuna: Digital Annotation for Teaching and Learning
http://www.lacunastories.com
GNU General Public License v2.0
36 stars 20 forks source link

fresh install - failed to add course #135

Closed kbalint closed 6 years ago

kbalint commented 8 years ago

Hi, just trying to get a test version up and running, with Lubuntu 16.4, LAMP. Originally the LAMP option in the Lubuntu installer set it up with php7.0.4, but I got an error:

Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 175 of /var/www/LacunaStories/includes/entity.inc).

I've downgraded to php5 (5.6.22-4+deb.sury.org~xenial+1) but still has this same error.

I only tried to add a Course, but it failed me on step 1.

Do you possibly have a pre-built VM image, I'd be interested trying out your application than becoming drupal devops, thanks.

mwidner commented 8 years ago

I haven't tried running it on that setup, but I can provide a VM, sure thing. The PHP warning can be safely ignored. I've looked into it, too, and it seems like it's being triggered by a contributed module, not our custom code. But, either way, it's not the cause of the error.

Can you tell me what steps you took to add a course and what error you received?

kbalint commented 8 years ago

Hi, thank you for your quick reply.

I rebooted my VM, I'm at ~/?q=node/add/course filled out the form, and when I submit, get the following error, now two lines:

Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 175 of /var/www/LacunaStories/includes/entity.inc). There was an error creating your course. Please try again and/or contact the Lacuna Stories team for assistance, info@lacunastories.com.

I resubmitted the course several times, and mysteriously it finally saved it to the db (it shows up on the open page as well). The second line of the error text changed to 'can't send email...' (thats OK, I didn't configure sendmail). Now I can start testing :)

Is it possible to configure the application to save a detailed error log? I've checked the apache logs, and only the sendmail error is there.

mwidner commented 8 years ago

Oh! Looks like you don't have clean urls enabled. That is required for the software to work. Here's the instructions for that:

https://www.drupal.org/getting-started/clean-urls#enabling-7

The error logs are stored by Drupal, separately from the apache logs. Here's information about how to see the logs: https://www.drupal.org/documentation/modules/dblog

Generally, I recommend turning them off unless you're doing development. There are some warnings that don't affect the functionality, but that are annoying to see all the time (like the array_flip() one).

kbalint commented 8 years ago

Thanks for the input!

1) I've enabled clean urls.

Well it's funny - I've missed it in the documentation, because I've clicked the "Post-installation task" inner link on the top of the github open page, and this "NOTE: Clean URLs are required for annotations to work" warning is at the end of the "Installation Instructions" part, and not in the "post-installation task" part.... and I never scrolled upward :)

2) I disabled the warnings as well.

3) I'm back to the original problem, can't create Course #2. I looked around in the menu, and found the error log, so the real message is this:

PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'field_unregistered_students_value' at row 1: INSERT INTO {field_data_field_unregistered_students} (entity_type, entity_id, revision_id, bundle, delta, language, field_unregistered_students_value) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6); Array ( [:db_insert_placeholder_0] => node [:db_insert_placeholder_1] => 11 [:db_insert_placeholder_2] => 11 [:db_insert_placeholder_3] => course [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => ) in field_sql_storage_field_storage_write() (line 514 of /var/www/LacunaStories/modules/field/modules/field_sql_storage/field_sql_storage.module).

I currently don't have any other users, just my admin account. I've filled in the "expected enrollment" value (=44) on the form, I see no other numeric value there.

mwidner commented 8 years ago

Hmm... I'll see if I can duplicate it. In the meantime, can you try dropping the database, reinstalling, then making sure clean URLs are enabled before adding a course? I suspect that it may be related to the problems you had before that was on.

kbalint commented 8 years ago

Hello, I've tried dropping the database, reinstalling - the same error is happening. I even created other users (researcher, student) before adding a course, same error.

mwidner commented 8 years ago

Ok. Thanks for trying that. One more question: can you give me the steps you're taking to create a course?

mwidner commented 8 years ago

Just a quick update: I've replicated this bug and have it in our queue to fix. In the meantime, it looks like a one time issue that goes away after reloading the page and does not seem to affect functionality.