Incredible!! Bruno17 your a genius!!
not me! Jason and Shaun are genius. They do the great work with xpdo, modx, the modx-api and formit.....
I’m just trying to understand how it all interacts and how one can use it instead of making crosswords or collecting stamps in my spare time.
i found :
in the snippet formit2db, :
foreach ($scriptProperties[’fields’] as $field=>$value)
{
if ($field !== ’spam’ && $field !== ’resource_id’){
{
$doc->set($field, $value);
}
}
Quote from: lolotlm at Sep 17, 2010, 12:42 PM
i found :
in the snippet formit2db, :
foreach ($scriptProperties[’fields’] as $field=>$value)
{
if ($field !== ’spam’ && $field !== ’resource_id’){
{
$doc->set($field, $value);
}
}
fixed that
That is very lovely indeed.
Two quickies:
1. You appear to have changed the name of the hooks since you first replied on this topic - the name in the snippet call (db2formit and formit2db) differs from the names above the blocks of code (resource2formit and formit2resource, which might confuse some people. Also, I assume ’strasse’ is a tv you were testing with?
2. I probably don’t need to understand this or care at present, but it seems wrong that the anonymous user can create resources in the database in this way. (Although thinking about it, I guess that’s exactly what Quip does)
Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
Quote from: odeclas at Oct 06, 2010, 04:01 PM
That is very lovely indeed.
Two quickies:
1. You appear to have changed the name of the hooks since you first replied on this topic - the name in the snippet call (db2formit and formit2db) differs from the names above the blocks of code (resource2formit and formit2resource, which might confuse some people. Also, I assume ’strasse’ is a tv you were testing with?
thanks, fixed that. ’strasse’ is a example-TV
Quote from: odeclas at Oct 06, 2010, 04:01 PM
2. I probably don’t need to understand this or care at present, but it seems wrong that the anonymous user can create resources in the database in this way. (Although thinking about it, I guess that’s exactly what Quip does)
you should use that on private resources only, where you have to be logged in to see them, of course.
Hey!
I have a question regarding the formit2resource postHook. What about using the process in core\model\modx\processors\resource\create.php? Is this possible?
I think it’s always good to use methods from the core. For example in the posted formit2resource postHook no alias is autocreated and no events are triggered. Using the build-in process to create a resource may be an advantage if the workflow of creating a new resource will change in a future version of modx: you don’t have to adapt your snippet because it uses the system process.
Add-On to easily manage your multilingual sites:
Babel
-
☆ A M B ☆
- 24,524 Posts
As I understand such things at this admittedly very much beginner stage with Revo, the core has security checks that make it awkward at best to use core functions from the front-end. I’m sure there’s a way to do it, but from what I’m seeing on the forums it’s not yet well-established and documented how to do it. (yes, phpthumb, I’m talking about you!)