Can you pass pre-defined values to a formio text field from a static query string - query-string

I have a simple formio form set up with a basic text field component that I want to pass a value to based on a link a user will click to open the form.
I have tried passing a value with simple URL query string values.
My text field is named projectNumber. Tried passing values with something like this - https://url.com/formpage?projectNumber=project1 but it will not accept the value. I'm sure there is something simple I am missing. I have searched around quite a bit and gone through the formio documentation but have been unable to find anything related to what seems like a fairly simple scenario.
Has anyone else dealt with this situation and found a solution?

Related

Display label based on, field on one data-source (singular) being within another data-source fields many

I am still learning, and looking for help on how to display a label based on one data-sources field value, being within another data-sources field value list.
I have one calculated table, displaying rows of documents within a folder, and wish to use a field representing the document number in that data-source, so that if it's ANYWHERE within another tables field it displays my label.
I've been trying to use projection as I think this is how to achieve it.
I can get it working based on both the current #datasouce.item.fieldnames but need it to base the calculation on all possible numbers in that tables field (Image below should make it easier to understand).
I expect that it has something to do with projections, but can't find anything within the learning templates or anywhere else to resolve the issue.
I think the following should work for you. For the 'Reserved' label have the following binding for the text property:
(#datasources.project_quotes.items..quotenumber).indexOf(#widget.datasource.item.Qnumber) !== -1 ? 'Reserved' : ''
I would suggest alternatively just to include a field in your calculated datasource and making the determination in your server script.

Change field length in drupal unit description

I'm having trouble using Drupal Rooms module.
This is when I input a description for unit.
Maximum length of Unit description is said to be 255.
I wanna input longer.
I figured out that those are stored in tables - field_data_unit_description_description and field_revision_unit_description_description.
I altered those tables, changed the length of the field to 2048.
But it still says "the text may not be longer than 255 characters."
I tried to change this value in db manually, but it never changed....
If i change the value in the site, the value in db changes, but if i change the value in db, it's not shown in the site.
Please help me.
I solved this problem myself by making a new attribute field for this.
It's quite better way I think since it works well and is fully customizable.
Created a new field in Manage Fields panel, with field attribute : Long Text.
It worked well.

How can I add a conditional field

I would like to have one field appear conditionally based on the value of another. How should I go about achieving this in dexterity?
E.g. One field is a boolean: Is the resource for sale?
If this is set as "yes" I'd like the next field to show up, being an integer- the price of the resource.
If I had to guess, I'd start hacking a javascript solution but I'm assuming there is a technique for doing it in an organised manner, but I can't find anything.
I should also mention that I am doing this to simplify the process of searching through this content later (using eea.facetednav) in which I don't know how to have a boolean search interface return results based on if the integer is > 0.

Update WordPress Posts Inside Loop

I have some processing inside my WordPress loop, and I want to "cache" the results so that the next time the post is displayed I can use the pre-processed info. The obvious place to store the results is as post metadata.
I have therefore incorporated a number of Update_post_meta calls into my code, along the following lines:
update_post_meta($imagePostID, "imageMeta", $imageMeta);
In this the value of $imagePostID is just the numeric Post ID, which I have already used to retrieve other metadata, so that's OK. I have also confirmed that the code is getting called at the right point.
However, the values are not getting saved, and it looks like for some reason the updates are just being ignored.
Does anyone understand why this is, and if there's any way to get the behaviour I want?
Thanks,
Andrew

Change Field Type from Int to Float

I'm helping a co-worker with a Drupal (6) issue, but I've never used Drupal before. The client wants to store decimal values in a field that was originally defined as an integer. I can't believe that this isn't possible without losing content or without doing a bunch of SQL copying, but I can't find anything that says, "sure, you can update the field type pretty easily, just do...".
Is this possible? So far:
We've altered the the content_type_thing table so that the _value field is now a float data type rather than an int.
We've updated the content_node_field table so the type value for that field is number_float
Now we can change the value from 1840 to 1840.25 without getting a validation error, but the .25 never gets saved. It gets chopped off and we get 18.00 in the database.
Any ideas?
Thanks.
UPDATE
Before anyone asks, I have read this post, but it looks like the recommendation involves a bunch of data migration. I just can't believe that there's not a way to change the data type in place.
This is pretty straight forward my friend. download this module
http://drupal.org/project/formatted_number
When you install it, go to the content type and change that field to use float.
Actually there is a solution but it's not easy and if you don't know exactly what
you're doing it may have side effects
https://drupal.stackexchange.com/questions/79378/changing-a-field-type-from-integer-to-decimal

Resources