Comments (10)
👍 review on the PR. Thanks so much for your attention and effort to this @DiegoPino !!!
from webform_strawberryfield.
Hi, Good catch.
But happens that rdftype_family_name
depends (in my silly brain) on using rdftype.
here:
webform_strawberryfield/src/Element/WebformMultiAgent.php
Lines 192 to 194 in 89ee257
So if not using rdftype
then we should disable the autocomplete right instead of forcing rdftype?
from webform_strawberryfield.
So here change it to
elseif ($agent_type == 'family' && !empty($rdftype_family_name)) {
?
from webform_strawberryfield.
@patdunlavey maybe (most likely 😆 ) I did not understand the use case (yes, I got the error). Can you share the webform element config? Sorry I have too much code & devops today in my brain
from webform_strawberryfield.
Or the desired/expected functionality or a screenshot of the element configuration in the UI
from webform_strawberryfield.
Sorry for taking so long to respond. Lot of head-scratching here. I don't understand the config that causes this. I'm using an extended version of the WebformMultiAgent class, but all it does is add a few additional text fields; the configuration options are unchanged. I've been through my customized class with a fine-toothed comb and cannot see where it could be affecting this. But when I changed it to a standard WebformMultiAgent field, configured exactly the same (I just edited the webform source, changing #type
to metadata_multiagent
), I'm not seeing errors, and the autocomplete works fine. Here's the relevant part of the source:
contributor_info:
'#type': metadata_multiagent_acdc
'#title': 'Contributor Info'
'#multiple': true
'#multiple__min_items': 0
'#multiple__empty_items': 0
'#multiple__add': false
'#multiple__add_more_input': false
'#agent_type__title_display': before
'#vocab_personal_name': names
'#vocab_corporate_name': names
'#vocab_family_name': names
'#role_type': loc
I'm not surprised that you haven't been able to reproduce this error because I haven't been able to either - except for the original one, which persists! So I don't know for sure that this is a bug in webform_strawberryfield\Element\WebformMultiAgent::processWebformComposite
.
What I do know is that the existence of the variable $rdftype_family_name
is not guaranteed when it reaches line 229, and when not present, it throws the errors I described. That, simply as a code review matter, seems like a good enough reason to me to either:
- Guarantee that
$rdftype_family_name
exists by setting it to a default value earlier in the code, or - Test to see if it exists, and don't try to use it if it doesn't.
Much as I'd love to be able to provide guaranteed steps to reproduce the problem, that has evaded me. But I don't think that's an absolute requirement to address what, I think one can make a case for, is a code review issue?
I am able to make the white screen error go away by overriding the method in my class, by setting $autocomplete_label_default['rdftype'] = $autocomplete_label_default['rdftype'] ?? "FamilyName";
(this doesn't make the php warning go away, however). Or I can make my own patch to the webform_strawberryfield
module. Obviously I'd rather do neither!
from webform_strawberryfield.
from webform_strawberryfield.
Thanks Diego. I DM'd you the two classes on slack.
from webform_strawberryfield.
from webform_strawberryfield.
Resolved via 1669a66
from webform_strawberryfield.
Related Issues (20)
- no way to clear Open Street Maps geolocation data HOT 1
- WebformMetadataDate webform elements generate php notices from \Drupal\webform\WebformSubmissionConditionsValidator::checkConditionTrigger HOT 1
- WebformMetadataDate wrongly array filters empties
- Europeana API changed their base URLs HOT 1
- Wrong use of static:: in WebformPanoramaTour HOT 1
- Fix Server Exception on Nominatim Controller HOT 1
- Provide Alternative/local LoD autocomplete vocabulary options HOT 1
- Webform Solr Autocomplete plugin passes %value% (means) not doing it the Solr way HOT 1
- When converting on the fly Objects to multi objects array we are not doing it right (webform widget) HOT 2
- Removed deprecation introduced in Search API 1.24+
- Solr driven Entity Reference needs Options initialized when called programmatically + add an exclude option HOT 2
- Macro ISSUE Drupal 10 Compatibility for 1.2.1
- Could you please implement the CIDOC-CRM integration feature? HOT 1
- How to show Webform Entity reference elements as a facet on the page /search ? HOT 2
- How to get face decection working? HOT 2
- Update for Getty AAT autocomplete HOT 1
- Support JSON-LD output please HOT 5
- Use Levenshtein distance to sort LoD Controller results. Much more accurate, less fuzz
- Add a preview limit and respect backend/code set limits for Entity References driven by Solr
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webform_strawberryfield.