This affects all the display plugin files (use_ajax will turn into usesAjax).
Annotations are:
* @Plugin(
* id = "attachment",
* title = @Translation("Attachment"),
* help = @Translation("Attachments added to other displays to achieve multiple views in the same view."),
* theme = "views_view",
* contextual_links_locations = {""},
* use_ajax = TRUE,
* use_pager = FALSE,
* use_more = TRUE,
* accept_attachments = FALSE,
* help_topic = "display-attachment"
* )
Apart from title and help, what should we do with the other properties? Should we do the same? I don't really know from how many places those are called and what / whether more files would be affected.
Working on the patch for usesAjax in the meantime.
Comments
Comment #1
dawehnerI think we should try to port them in groups which are logically connected, like uses_fields, uses_row_plugin, uses_row_class.
Comment #2
slv_ commentedPatch attached.
Comment #3
dawehnerThanks for you patch!
I have looked at the patch and i realized that the default of the value is set to TRUE, so only subclasses which changes that need to have this value. On the other side you somehow missed to rename the calls, so there was still $this->use_ajax used,
so here is a new version for that.
Comment #4
slv_ commentedAgree, no need to redeclare the property if it's not changing. Completely forgot about renaming the calls! Was the last step and missed it!. Thanks for the corrections, it looks good to me now.
Comment #5
aspilicious commentedtim will kill you for having camelcase properties:
+ protected $usesAjax = TRUE;
Hmm why define this property again in Feed?
+ /**
+ * Whether the display uses AJAX or not.
+ *
+ * @var bool
+ */
+ protected $usesAjax = FALSE;
I would just set the basePlugin $uses_ajax in the constructor
Comment #6
tim.plunkettlowerCamelCase properties are correct.
And overriding it is how we did the other ones, so that's fine.
Comment #7
aspilicious commentedWhoops I was mixing properties with variable names. (/me is still tired)
Oh rly? Never done such things before in other programming languages but whateva :)
Rtbc than
Comment #8
dawehnerMh, this sadly changes the logic. Sadly that's my fault, but to keep a good standard we should talk about how to handle that.
For example $this->definition['use_ajax'] could directly use $this->usesAjax instead of calling the function. Alternative an additional parameter could also help. Any opinions?
Comment #9
dawehnerWe kind of agreed that there should be two methods:
Here is a patch which should do that.
Comment #10
slv_ commentedI'd suggest a name change for getUsesProperty. As it is, seems confusing and is not quite clear what it does differently from usesProperty.
If before accessing an option we need to check whether the option is allowed or not, I think it makes sense to call the method something like "allowsProperty". I think that way what the function does is self explanatory.
Patch attached with the suggested change.
Comment #11
aspilicious commentedif you go with that I should rename the property too
Comment #12
slv_ commentedThat's right. Amended here.
Is it the same case then for $usesOptions and other changes recently done?
Comment #14
slv_ commentedOh, the rush...
Comment #15
slv_ commentedComment #16
tim.plunkettThis makes sense as a comment.
This does not make sense as a comment.
Comment #17
slv_ commentedSenseless, indeed!
Corrected and attached.
Comment #18
slv_ commentedSo, patch re-rolled. Renamed usesAjax() function to isAjaxEnabled().
Comment #19
tim.plunkettallowsAjax to usesAJAX
isAjaxEnabled to isAJAXEnabled
Comment #20
slv_ commentedpatch re-rolled
Comment #21
aspilicious commentedStill the same and don't forget the property
Comment #22
slv_ commentedSorry, thought it was a writing mistake on #19! We actually wanted it back to usesAJAX! Patch re-rolled.
Comment #23
damiankloip commentedThat seems good to me.
Comment #24
dawehnerCommitted it now!
Comment #26
xjmComment #27
xjmComment #28
chris matthews commentedFor more information as to why this issue was moved to the Drupal core project, please see issue #3030347: Plan to clean process issue queue
Comment #29
chris matthews commentedMoving back to the contributed Views issue queue and closing as outdated per https://www.drupal.org/project/views/issues/3030347#comment-13023447