addblock problem
Permalink
Add article the problem of the block
error: mysql error: [1048: Column 'arHandle' can not be null] in EXECUTE ("insert into CollectionVersionBlocks (CID, CVID, BID, arHandle, cbDisplayOrder, isOriginal, cbIncludeAll) values ('1036 ', '2', '2680 ', NULL, 0, 1, '1') ")
arhandle can not be NULL.
arHandle? in which the data come.
<? php
$ bt = BlockType :: getByHandle ('reviews');
$ b = $ c-> addBlock ($ conn_id, $ arHandle, $ data);
$ bt-> controller-> mainCollection = $ c;
$ bt-> controller-> setCollectionObject ($ c);
$ bt-> controller-> title = 'Comments';
$ bt-> controller-> requireApproval = true;
$ bt-> controller-> authenticationRequired = false;
$ bt-> controller-> displayCaptcha = false;
$ bt-> controller-> displayGuestBookForm = true;
$ bt-> controller-> notifyEmail = 'info@xyzkadin.com';
$ bt-> render ('templates / article-review / view');
?>
Where is the problem where I'm doing wrong.
error: mysql error: [1048: Column 'arHandle' can not be null] in EXECUTE ("insert into CollectionVersionBlocks (CID, CVID, BID, arHandle, cbDisplayOrder, isOriginal, cbIncludeAll) values ('1036 ', '2', '2680 ', NULL, 0, 1, '1') ")
arhandle can not be NULL.
arHandle? in which the data come.
<? php
$ bt = BlockType :: getByHandle ('reviews');
$ b = $ c-> addBlock ($ conn_id, $ arHandle, $ data);
$ bt-> controller-> mainCollection = $ c;
$ bt-> controller-> setCollectionObject ($ c);
$ bt-> controller-> title = 'Comments';
$ bt-> controller-> requireApproval = true;
$ bt-> controller-> authenticationRequired = false;
$ bt-> controller-> displayCaptcha = false;
$ bt-> controller-> displayGuestBookForm = true;
$ bt-> controller-> notifyEmail = 'info@xyzkadin.com';
$ bt-> render ('templates / article-review / view');
?>
Where is the problem where I'm doing wrong.
$arHandle isn't initialized in your code. How should that script be able to add a new block in the database if that parameter is empty? Every block needs to be part of an area!
I'm not an expert in concrete5. exactly what you need to do with the code.
First of all: What are you trying to achieve? Do you want to display a block from code or do you want to add a block to a page with code?
I'm trying to add a block comment on articles. as you said, I'm trying to add a block of all the articles.
Where did you put that code you've posted?
Please make sure your php code is correct first. Remove the spaces after the $ signs in your variable names. For example:
$ bt should be $bt
$ b should be $b
$ c should be $c
$ conn_id should be $conn_id
$ arHandle should be $arHandle
$ data should be $data
$ bt should be $bt
$ b should be $b
$ c should be $c
$ conn_id should be $conn_id
$ arHandle should be $arHandle
$ data should be $data
put into themes/domainname/articleread1.php.
but I just do not have the image shows the functionality of any article. does not form action code. consequently does not work.
I hope you have the answer you want.
but I just do not have the image shows the functionality of any article. does not form action code. consequently does not work.
I hope you have the answer you want.
Mhawke, I have already done so, it would generate appeared here.
Sorry about that.
Enclose code samples in [code][/code]
Enclose code samples in [code][/code]