500 - Can not edit item, because item id is not set

More
13 years 4 months ago #28507 by yaK2manD
Hello,


I have the following error : 500 - Can not edit item, because item id is not set
when the my personal script return false.


Is that normal ?

Edit : J!2.5 / r1475

Thank you

Please Log in or Create an account to join the conversation.

More
13 years 4 months ago #28509 by ggppdk
This means that the HTTP Request GET/POST variable cid (backend) or id (frontend) is not set and thus the item model does not know which item to edit

You mean you return false where, you mean inside the plugin function onBeforeSaveField() ???


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
13 years 4 months ago #28513 by yaK2manD
exactly. inside the plugin function onBeforeSaveField()


code.google.com/p/flexicontent/i ... %20Summary

Please Log in or Create an account to join the conversation.

More
13 years 4 months ago #28514 by ggppdk
Which revision do you use?

is it when clicking to create new item?


Returning false on a new item, will not create the item, but i think we redirecting to a new item form again


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
13 years 4 months ago #28526 by yaK2manD
I use r1475.

Yes, it is on creation.

Please Log in or Create an account to join the conversation.

More
13 years 4 months ago #28527 by ggppdk
Ok i ll test and fix this later today


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
13 years 4 months ago #29097 by yaK2manD
I have tested with r1498 and the error still happen

Please Log in or Create an account to join the conversation.

More
13 years 4 months ago #29101 by ggppdk
What are you returning with onBeforeSaveField, you are returning boolean false?


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

More
13 years 4 months ago #29115 by yaK2manD
yes. I process a test :
Code:
$db2 = JFactory::getDBO(); $query = " SELECT COUNT(*) FROM ".$db2->nameQuote('#__mydb')." WHERE ".$db2->nameQuote('field1')." = ".$db2->quote($field1)." AND ".$db2->nameQuote('field2')." = ".$db2->quote($field2)."; "; $db2->setQuery($query); $count = $db2->loadResult(); if ($count >= 1 && $item->version < 1) { $jAp=& JFactory::getApplication(); $jAp->enqueueMessage("Notice12", 'notice'); return false; }

Please Log in or Create an account to join the conversation.

More
13 years 4 months ago #29116 by ggppdk
a yes for new items we should redirect to add item and not to edit item, but i think i have implemented this when canceling item saved was implemented i ll check it now, to verify


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save