How to get passwordSignupFields from Accounts.ui - meteor-accounts

I have the following code in my meteor project:
Accounts.ui.config({
passwordSignupFields: "USERNAME_ONLY"
});
Is there a way to get the value of the passwordSignupFields property afterwards? If so, how do I reference it? (eg. is it Accounts.ui.passwordSignupFields or something else? )

it is Accounts.ui._options.passwordSignupFields .

Related

Using getBounds on geoJSON feature

I've tried map.fitBounds(geojsonFeature.getBounds()); and I get this error:
geojsonFeature.getBounds() is not a function.
Here is the code: http://jsfiddle.net/0aqxktov/
What is going wrong here?
Thanks in advance.
Your variable geojsonFeature is just an object, there is no method named getBounds() there, as you can easily check.
Instead of that, give your geoJSON layer a name...
var feature = L.geoJson(geojsonFeature).addTo(map);
And use that to call getBounds():
map.fitBounds(feature.getBounds());
Here is the updated JSFiddle: http://jsfiddle.net/qofrgm2k/

Property Mapping Exception in Helhum upload example

I am using helhum File Upload Demo to upload the images. But currently i got below error.
Exception while property mapping at property path "images.0":Property "name" was not found in target object of type "XXXX\XXXXX\Domain\Model\FileReference
Please help here.. How can i move forward.
Thanks in advace.
If you followed the example extension, you are maybe missing the registration of UploadedFileReferenceConverter and ObjectStorageConverter in your ext_localconf.php. Took me a day to find that one:
ext_localconf.php
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerTypeConverter('Vendor\\EXT\\Property\\TypeConverter\\UploadedFileReferenceConverter');
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerTypeConverter('Vendor\\EXT\\Property\\TypeConverter\\ObjectStorageConverter');
In the initializeUpdateAction (or initializeCreateAction) you have to use the name of the parameter in the updateAction (or createAction) as argument.
If your updateAction looks like this:
public function updateAction(\Classname $yourObject)
You have to call the helhum function with the argument:
$this->setTypeConverterConfigurationForImageUpload('yourObject');
As a small hint for later problems: In the setTypeConverterConfigurationForImageUpload function you should register your own file attributes if they are not named image and/or imageCollection.0 like in the example.

Issue with using polymorphic_path with FactoryGirl build object

I am using factory_girl and rspec2 for my testing. I have an issue with the following code:
let(:book) { build(:book, id: 1) }
book_path(book)
book_path statement is generating /books url instead of /books/1. I can use create, but any suggestions on how to fix this using build strategy?
I am using
rspec-rails (2.11.0)
factory_girl (3.5.0)
Try book.to_param (that's actually what book_path(book) is doing under the hood) and see what it returns. By default to_param returns id, but your book is not saved yet, so it can return nil.

Get object in i18n form

Inside embedded i18n form i need to get object.
In this example i got ArtistImageTranslation object, but i need ArtistImage.
Can somebody help me, how to get this?
class ArtistImageTranslationForm extends BaseArtistImageTranslationForm
{
public function configure()
{
$this->getObject();
....
}
}
Have you tried the following?
$artistimage = $this->getObject()->getArtistImage();
I spent half of day today on the same problem and looks like I finally found something ;)
First, if you need to access the fields which are in the "Translation" part of the table you can access them directly from the Object contained in the form. Just access the properties without using the getter (I know it's not the nice way but it works). So you can use something like:
$this->getObject()->id;
$this->getObject()->translated_name;
etc.
If you really need the original object you can access it like this:
$this->getObject()->getTable()->getRelation('ArtistImage')
->fetchRelatedFor($this->getObject());
Hope this helps.
Try :
$artistimage = $this->getObject()->artistImage;
or
$artistimage = $this->getObject()->artist_image;

A way in fiddler to replace a parameter before submiting the answer to the server

I tried to write in the CustomRules.js in OnBeforeResponse method:
if(oSession.PathAndQuery.StartsWith("/feed/predata/1-1-"))
{
oSession["PathAndQuery"] = oSession.PathAndQuery.Replace("false","1");
}
The full PathAndQuery looks like that
/feed/predata/1-1-false-2.dat
When i try to save the file I get an error sound without a messagebox to show me where the error is.
I also tried this code:
oSession.PathAndQuery = oSession.PathAndQuery.Replace("false","1");
What is the correct way to perform this action?
Thanks in advance,
Oz.
If you're trying to change the request, you need to put your code in the OnBeforeRequest method.
Also,
oSession["PathAndQuery"]
doesn't do anything you want it to. Use this instead:
oSession.PathAndQuery = oSession.PathAndQuery.Replace("false","1");