Hello,
I tried to directly access the value of a serial field with entity_metadata_wrapper.
But but unfortunately, the value seems to be missing when I try to get the info with $wrapper->getPropertyInfo().
All other fields of the node are normaly listed.
Any ideas what is going on?
Thanks
William
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | interdiff-2323277-5-6.txt | 682 bytes | br0ken |
| #6 | serial-entity-wrapper-support-2323277-6.patch | 16.9 KB | br0ken |
Comments
Comment #1
br0kenHi.
Helpful module, thanks to author.
Historically, that I use
entity_metadata_wrapper()function to obtain the values of fields and this module is lacking a trifle for similar work withserialfields. Entity wrappers allowed only for fields that has the property_type in their definition in hook_field_info. My patch not only solves this problem, and also contains many improvements to the code style according to Drupal design standards.P.S. Please, do not delay the consideration, because I like to use this module on my active project as "contrib".
Comment #2
br0kenAlso, tokens works fine now. No need to implement additional functionality, because we can use token of field name.
F.e.: when the name of field is
field_serial, then it token will be[node:field_serial]. You can see this yourself by looking on Pathauto patters onadmin/config/search/path/patternsDue to that, think the documentation should be a little bit fixed.
Comment #3
br0kenbot up
Comment #4
m1r1k commentedPut adding tag outside of foreach.
Use EntityFieldQuery here and then node_load_multiple
That's actually PHP 5.4+ requirements.
Wrap all config queries with static cache
Where is documentation about it? Or it is just your preferences?
What is the reason of removing it? Add token implementations or leave it as it is :)
Comment #5
br0ken1. This is very moot point. I've leave this code as it was and just remove the unnecessary variable.
2. Query was replaced by
node_load_multiple.3. Chaining is allowed from PHP 5+. We're not call the method from instance directly.
4. No need to do that, because this function needs only for internal usage in different places.
5. This is a best practice that protects from wrong variable assignment in condition.
6. The commented code was removed because it is unnecessary. For all Drupal fields tokens generated automatically (see comment #2).
Comment #6
br0kenFound an issue while working with Features and Serial Field. Sometimes reverting operation is failed due to existing table for serial field.
Comment #7
colanI'm one of the maintainers, and just reviewed the code. It looks great; thanks for working on this. As I don't have an environment set up to test this, let's wait for someone else to independently verify that it works. (If you know somebody, please ask him/her.)
Once it's RTBCed, we can commit.
Comment #8
gaydamaka commentedHi, I looked the code and test the module. Errors in the module I have not found.
Comment #9
artem.vilkov commentedHi guys, thanks for working on this.
I've installed the module and patch was applied successfully. Then I've created couple nodes with serial field in content type and test it accessibility by metadata wrapper. Everything works fine.
Comment #10
br0kenGreat, thanks guys. I'll do my first commit to this module ASAP.
Comment #12
br0kenThanks all for work, new release (7.x-1.4) was done.