Question
Is there any way to get from a HASH() value to the actual value of some meta data in a plugin Perl module?
This code:
my $status = $meta->get( 'FIELD', 'Status' );
Returns a string "HASH(0x...)" that is presumably a look-up into a metadata store.
Or maybe there is a better way to get form field data from a topic in a plugin? The documentation on access to metadata is a bit sketchy.
Environment
--
TWikiGuest - 19 Sep 2007
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
The result of that call is a hash containing the information for the field "status". This information has the following fields:
- name - the name of the field
- attributes - Any special attributes as declared in the form definition ("H" for hidden, etc)
- title - How it's displayed, usually the same as name
- value - the actual value of the field
So, if you need the value of a form field, what you need to do is:
my $field = $meta->get( 'FIELD', 'Status' );
my $status = $field->{value};
Each kind of META has its own structure. The best way to learn it is to see the topic txt file.
--
RafaelAlvarez - 19 Sep 2007
See docs at
TWikiMetaData.
--
PeterThoeny - 26 Sep 2007