Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There's an option to use PHP code in preparing the Arguments for the weight field, there's no explanation for this field.
In any other module I've seen, whenever there's a PHP code field, there's help text to indicate the following:
- what, if any, variables are available
- if
<?php
and?>
should be used - what, if anything, should be returned
It would be great to see this under the PHP code field. I have no idea what I'm supposed to do with this field.
Worse yet, is that if I guess, and put something incorrect into that field, the field handler is broken beyond repair. (Ajax errors prevent editing and fixing of the field setting)
Comment | File | Size | Author |
---|---|---|---|
#8 | draggableviews-document-argument-handling-1878164-8.patch | 2.94 KB | iStryker |
#3 | draggableviews-prepare_args_PHP_code_documentation-1878164-3.patch | 7.26 KB | iStryker |
Comments
Comment #1
nagy.balint CreditAttribution: nagy.balint commentedI've just ran into this issue today.
Please include a help text there.
Comment #2
ygerasimov CreditAttribution: ygerasimov commentedI can see following help text under php field:
Enter the php code to prepare the arguments. Do not enter <?php ?> tags. The following variables are available - $view (the view), $arguments (existing arguments - manipulate these to alter the arguments used to sort).
Please advise how to change it so it is more understandable. Also see README.txt for more documentation.
Comment #3
iStryker CreditAttribution: iStryker commentedAdded "See README.txt for more details" and updated README.txt file. README.txt include additional updates in this patch.
Committed 9513d79
Comment and/or reopen if not satisfied.
Comment #5
Chris Gillis CreditAttribution: Chris Gillis commentedAn example would be helpful. Would be good to let the user know they are supposed to end with
return $arguments;
.Comment #6
iStryker CreditAttribution: iStryker commentedMessage to add with or without patch is welcomed.
Comment #7
Chris Gillis CreditAttribution: Chris Gillis commentedComment #8
iStryker CreditAttribution: iStryker commentedThanks, updated the patch. I did not change any wording, just moved stuff around to be easier to read.
Comment #9
iStryker CreditAttribution: iStryker commentedCommitted.