Hi,
This post is somewhat related to http://ellislab.com/forums/viewthread/168669/, but I am posting here as the questions are of development nature and focused on a few spesific issues as opposed to the more general questions in the previous post. I’m running expressionengine 2.x
I’ve got an extension that takes a channel entry during the ‘entry_submission_ready’ phase and checks the file field for the image path.
function blend_image($metaData, $dataValues, $autosave){.....}It then takes that image along with a background image and does some post-processing with the GD library to merge the images together and save the new image. I’ve verified that the new image gets created and is in the same upload directory as the original image. However I can’t seem to find a way to substitute the original value in the file field with the new url. I’ve tried setting the value in $dataValues and even tried passing $dataValues as reference to see if that helped, but to no avail. Is there any way of passing the new value on to the entry that is about to be made or do I actually have to look into the submitting entry first, then re-update it?
Second extension I have is doing something similar. It looks at an entry I’ve just submitted during the ‘entry_submission_end’ phase and checks a file field for the image url. It then checks the entries in a different channel ( for images ) to see if the url already exists. If it doesn’t it will create a new entry for the image. The problem I have here is that calling
($this->EE->api_channel_entries->submit_new_entry( $image_channel_id, $data)yields the following
An Error Occurred Creating the Entry:
Array
(
[Heading] => The following field is required:
[Text] => The following field is required:
)These values are NOT part of the image channel ( and id is set correctly ) but rather the news channel. So it seems to me that it for some reason expects values from the entry I’ve called the extension from. Is this an issue with the table model having all field_ids and it can’t distinguish between models? (In other words, do I need to add all required fields regardless and pass null values to those not relevant for channel? )
Hope someone has an answer or know which pages/post to direct me to for more information.
Cheers.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.