## Dataform (plugin)

### Dataform - Entry state and access function

This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.
Dataform - Entry state and access function

Hi,

I'm trying to finalize a certain scenario with the help of datafrom. Unfortunaltey in the last couple of days I have found couple of bugs in the following functions:

1. There is a problem with an entry state field. I have two states: "Submitted" and "Approved", and two allowed transitions from "Submitted" state to "Approved" state and in opposite direction. This transition is available only for Managers and Teachers. After trying to change the state for the second time I'm getting the following errors "JSON.parse: unexpected end of data", or "Unexpected end of input". Do you have any suggestions regarding this?

2. Access section:

Disseapring access rules (at least are not listed anymore) when I choose another option in the "Where this block appears". This is really annoying.

3. Notification block: would the notification function also work also at the time of changing the status in the entry state field?

Thank you for your help.

Average of ratings: -
Re: Dataform - Entry state and access function

1. Please open tracker issue at https://tracker.moodle.org/browse/CONTRIB/component/13430 (select component Set: Dataform) so that it could be investigated. Please provide a detailed scenario for reproducing the error message.

2. Not a bug. Access rules should be added in the Access index page and can appear only there. You should not change the 'Where this block appears' setting. I will look into disabling this setting in the access rule configuration.

3. I will look into that.

hth

Average of ratings: -
Re: Dataform - Entry state and access function

There is indeed a bug in entrystate field notification sending which seems to be the reason for the state update failure. See CONTRIB-5038. Should be fixed in the next couple of days.

Average of ratings: -
Re: Dataform - Entry state and access function

Dear Itamar,

great I'm looking forward to having this function.

Warm regards,

Paul

Average of ratings: -
Re: Dataform - Entry state and access function

I updated the Dataform module to version 2.6.3 and I am still having entry state errors.

Specifically, I have 3 entry states; "Submitted", "Approved", and "Denied".  I have set notifications to be sent to the author of the entry from the Admin any time Approved or Denied is selected and teachers are allowed to select Approved and Denied.  I submitted an entry from my test account.  I log back into my administrator account and selected either Approved or Denied and I receive a Syntax Error while using Internet Explorer and Unexpected End of Input while using Google Chrome.  No message is sent.

Average of ratings: -
Re: Dataform - Entry state and access function

Yes, it's not because of the notifications, but rather because of the calculated grade support that has been added to the entry state field in 2.6.3.

mod/dataform/field/entrystate/ajax.php, line 68

$df->update_calculated_grade($entry->userid, "##\d*:$field->name##"); is missing a character. The called method name should be 'update_calculated_grades' (plural grades): $df->update_calculated_grades($entry->userid, "##\d*:$field->name##");

You can try a quick hack until the next mini-release, and if you do please let me know if it worked for you.

Average of ratings: -
Re: Dataform - Entry state and access function

Dear Itamar,

this hack works at least in my case. Great work!

Average of ratings: -