Multiple changes:

- Shift ProfileField API so that new returns undef on invalid fields.
    This makes it possible for Shortcut::www_saveUserPrefs to execute.
    The class methods in ProfileField are now also actually class methods.

    + Also fix up other modules that created dummy ProfileFields so that
      they don't need to do that anymore, because it's now invalid.

  - Merge contradictory-looking code from Shortcut's view and www_view
    into a reasonable compromise in view, and then have www_view call
    $self->view in a manner similar to that of the default Asset::view.

    + The profile field overrides still don't work, because there's no
      obvious mechanism for "transclude asset in context".  This may
      require some fiddling to get right...
This commit is contained in:
Drake 2006-08-31 00:14:56 +00:00
parent 84e8d8f689
commit 565119fa1a
5 changed files with 57 additions and 36 deletions

View file

@ -55,7 +55,7 @@ The current WebGUI session object.
sub getRequiredProfileFields {
my $session = shift;
my @array;
foreach my $field (@{WebGUI::ProfileField->new($session,'dummy')->getRequiredFields}) {
foreach my $field (@{WebGUI::ProfileField->getRequiredFields($session)}) {
push(@array, {
'profile.formElement' => $field->formField,
'profile.formElement.label' => $field->getLabel
@ -146,7 +146,7 @@ sub validateProfileData {
my $error = "";
my $warning = "";
my $i18n = WebGUI::International->new($session);
foreach my $field (@{WebGUI::ProfileField->new($session,'dummy')->getEditableFields}) {
foreach my $field (@{WebGUI::ProfileField->getEditableFields($session)}) {
my $fieldValue = $field->formProcess;
if (ref $fieldValue eq "ARRAY") {
$data{$field->getId} = $$fieldValue[0];