"invite user to group" form on user profile page throws headdata error

Bug #1132660 reported by Melissa Draper
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Robert Lyon
1.5
Fix Released
High
Robert Lyon
1.6
Fix Released
High
Robert Lyon
1.7
Fix Released
High
Robert Lyon

Bug Description

[WAR] 1d (lib/pieforms/pieform.php:1408) Pieform element invite_group wants to add headdata to the page, but it's too late. Build your form before generating the page.
Call stack (most recent first):

    log_message("Pieform element invite_group wants to add headdata...", 8, true, true) at /var/www/mahara-dev/code/htdocs/lib/errors.php:109
    log_warn("Pieform element invite_group wants to add headdata...") at /var/www/mahara-dev/code/htdocs/lib/pieforms/pieform.php:1408
    Pieform->build_element_html(array(size 13)) at /var/www/mahara-dev/code/htdocs/lib/pieforms/pieform.php:659
    Pieform->build() at /var/www/mahara-dev/code/htdocs/lib/pieforms/pieform.php:162
    Pieform::process(array(size 4)) at /var/www/mahara-dev/code/htdocs/lib/pieforms/pieform.php:71
    pieform(array(size 4)) at /var/www/mahara-dev/code/htdocs/user/view.php:201

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

This might be a regression because it didn't happen before. I saw it only just now in my updated 1.7 local instance.

Changed in mahara:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Robert Lyon (robertl-9) wrote :

Looks like the problem here is probably this:

1) The invite_group and addmember_group contain select html tags that want to add some javascript to the page.
2) The $smarty-assign lines are mixed in with building parts of the page rather than being called at the end.

Possible fix:

Generate the forms first then call the $smarty instance and assign the form to $smarty

Revision history for this message
Robert Lyon (robertl-9) wrote :
Changed in mahara:
status: Confirmed → In Progress
assignee: nobody → Robert Lyon (robertl-9)
Changed in mahara:
milestone: none → 1.8.0rc1
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/2244
Committed: http://gitorious.org/mahara/mahara/commit/8a5a869eaf47d9b88f1f11762d1cf706553cfc31
Submitter: Son Nguyen (<email address hidden>)
Branch: master

commit 8a5a869eaf47d9b88f1f11762d1cf706553cfc31
Author: Robert Lyon <email address hidden>
Date: Mon May 27 10:08:32 2013 +1200

Fix for user profile page throws headdata error (Bug #1132660)

Problem was the $smarty instance created before forms were generated.
I moved the smarty instance call to after form generation and passed the
$smarty->assign calls to it then

Change-Id: I12705f06b22cee76cd84017e807ba2b0c5ef213e
Signed-off-by: Robert Lyon <email address hidden>

Aaron Wells (u-aaronw)
Changed in mahara:
status: In Progress → Fix Committed
Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/2264
Committed: http://gitorious.org/mahara/mahara/commit/a3b833a6fe625e4914d5e401ab457c239f61c74e
Submitter: Son Nguyen (<email address hidden>)
Branch: 1.7_STABLE

commit a3b833a6fe625e4914d5e401ab457c239f61c74e
Author: Robert Lyon <email address hidden>
Date: Mon May 27 10:08:32 2013 +1200

Fix for user profile page throws headdata error (Bug #1132660)

Problem was the $smarty instance created before forms were generated.
I moved the smarty instance call to after form generation and passed the
$smarty->assign calls to it then

Change-Id: I12705f06b22cee76cd84017e807ba2b0c5ef213e
Signed-off-by: Robert Lyon <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/2263
Committed: http://gitorious.org/mahara/mahara/commit/57220b0cd37d6e08dacf5c3e99826b575dec90ea
Submitter: Son Nguyen (<email address hidden>)
Branch: 1.6_STABLE

commit 57220b0cd37d6e08dacf5c3e99826b575dec90ea
Author: Robert Lyon <email address hidden>
Date: Mon May 27 10:08:32 2013 +1200

Fix for user profile page throws headdata error (Bug #1132660)

Problem was the $smarty instance created before forms were generated.
I moved the smarty instance call to after form generation and passed the
$smarty->assign calls to it then

Change-Id: I12705f06b22cee76cd84017e807ba2b0c5ef213e
Signed-off-by: Robert Lyon <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/2262
Committed: http://gitorious.org/mahara/mahara/commit/2606419878605b9595b9a63f15401f887549ba28
Submitter: Son Nguyen (<email address hidden>)
Branch: 1.5_STABLE

commit 2606419878605b9595b9a63f15401f887549ba28
Author: Robert Lyon <email address hidden>
Date: Mon May 27 10:08:32 2013 +1200

Fix for user profile page throws headdata error (Bug #1132660)

Problem was the $smarty instance created before forms were generated.
I moved the smarty instance call to after form generation and passed the
$smarty->assign calls to it then

Change-Id: I8230fffae49bccf0b3db4ceefb66ed07d0531936
Signed-off-by: Robert Lyon <email address hidden>

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

I got the following message on a 1.7 install after I upgraded from postgres 8.4 to 9.1. Don't know if it's related to that. It's just when I saw it.

[WAR] c2 (lib/pieforms/pieform.php:1408) Pieform element view_group_submission_form_42_options wants to add headdata to the page, but it's too late. Build your form before generating the page.
Call stack (most recent first):

    log_message("Pieform element view_group_submission_form_42_opti...", 8, true, true) at /home/kristina/code/17stable/htdocs/lib/errors.php:109
    log_warn("Pieform element view_group_submission_form_42_opti...") at /home/kristina/code/17stable/htdocs/lib/pieforms/pieform.php:1408
    Pieform->build_element_html(array(size 10)) at /home/kristina/code/17stable/htdocs/lib/pieforms/pieform.php:659
    Pieform->build() at /home/kristina/code/17stable/htdocs/lib/pieforms/pieform.php:162
    Pieform::process(array(size 6)) at /home/kristina/code/17stable/htdocs/lib/pieforms/pieform.php:71
    pieform(array(size 6)) at /home/kristina/code/17stable/htdocs/lib/view.php:4535
    view_group_submission_form(object(View), array(size 1), "view") at /home/kristina/code/17stable/htdocs/view/view.php:339

Aaron Wells (u-aaronw)
Changed in mahara:
milestone: 1.8rc1 → 1.8.0
Aaron Wells (u-aaronw)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.