{"id":412,"date":"2012-11-03T13:03:03","date_gmt":"2012-11-03T12:03:03","guid":{"rendered":"http:\/\/codingexplained.com\/?p=412"},"modified":"2017-06-11T22:20:47","modified_gmt":"2017-06-11T20:20:47","slug":"package-block-not-installing","status":"publish","type":"post","link":"https:\/\/codingexplained.com\/coding\/php\/concrete5\/package-block-not-installing","title":{"rendered":"concrete5 Package Block Not Installing"},"content":{"rendered":"<p>If you are developing a package containing one or more blocks, you may have found yourself wondering why on Earth your block is not installing with the package. Your package&#8217;s controller code may be perfectly fine and no error messages are given, but yet the blocks are not installed. Furthermore, your block&#8217;s code may also be completely correct and valid. If this is the case, then you are the victim of what seems to be a very silly bug in concrete5.<\/p>\n<p>Let us first ensure that your package controller&#8217;s code is correct. It should look something like the below.<\/p>\n<pre><code class=\"php\">public function install() {\r\n\t$pkg = parent::install();\r\n\tBlockType::installBlockTypeFromPackage(&#039;block_handle&#039;, $pkg);\r\n}<\/code><\/pre>\n<p>Now the catch is that your block&#8217;s <span class=\"code\">db.xml<\/span> file <em>must<\/em> contain at least two fields in the block&#8217;s table. As you probably know, your block type&#8217;s table should have a column named <span class=\"code\">bID<\/span>. What if you do not need to store any information about your block? In that case it would seem logical to only have the <span class=\"code\">bID<\/span> column in the table. As it turns out, that is not an option.<\/p>\n<p>For unknown reasons, there <em>must<\/em> be at least two fields in the table &#8211; even if you do not use one of them at all. While the column then seems completely redundant, it is necessary, because otherwise concrete5 will refuse to install your block. It will not give you any error message, so figuring out why your block is not installing can be a very daunting task.<\/p>\n<p>The solution is simple; simply add another field to your block type&#8217;s table. It does not have to be used in any way and the name and type does not matter. The structure below would solve the problem.<\/p>\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot;?&gt;\r\n&lt;schema version=&quot;0.3&quot;&gt;\r\n    &lt;table name=&quot;btMyBlock&quot;&gt;\r\n        &lt;field name=&quot;bID&quot; type=&quot;I&quot;&gt;\r\n            &lt;key \/&gt;\r\n            &lt;unsigned \/&gt;\r\n        &lt;\/field&gt;\r\n\r\n        &lt;field name=&quot;dummy&quot; type=&quot;I&quot;&gt;&lt;\/field&gt;\r\n    &lt;\/table&gt;\r\n&lt;\/schema&gt;<\/code><\/pre>\n<p>Reinstall your package and your block should now be installed successfully and be ready for use.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you are unsuccessfully attempting to install a block type together with a concrete5 package, then the cause may be a concrete5 flaw which is very hard to find and make sense of.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"jetpack_post_was_ever_published":false,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[55],"tags":[60,148,61,40],"series":[],"jetpack_publicize_connections":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>concrete5 Package Block Not Installing<\/title>\n<meta name=\"description\" content=\"If a concrete5 block is not installing together with a concrete5 package and the code is correct, then you might be the victim of a silly flaw in concrete5.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/codingexplained.com\/coding\/php\/concrete5\/package-block-not-installing\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"concrete5 Package Block Not Installing\" \/>\n<meta property=\"og:description\" content=\"If a concrete5 block is not installing together with a concrete5 package and the code is correct, then you might be the victim of a silly flaw in concrete5.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/codingexplained.com\/coding\/php\/concrete5\/package-block-not-installing\" \/>\n<meta property=\"og:site_name\" content=\"Coding Explained\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/codingexplained\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/codingexplained\" \/>\n<meta property=\"article:published_time\" content=\"2012-11-03T12:03:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-06-11T20:20:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/codingexplained.com\/wp-content\/uploads\/2015\/11\/codingexplained-fb-promote.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"444\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Bo Andersen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@codingexplained\" \/>\n<meta name=\"twitter:site\" content=\"@codingexplained\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Bo Andersen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/codingexplained.com\/coding\/php\/concrete5\/package-block-not-installing\",\"url\":\"https:\/\/codingexplained.com\/coding\/php\/concrete5\/package-block-not-installing\",\"name\":\"concrete5 Package Block Not Installing\",\"isPartOf\":{\"@id\":\"https:\/\/codingexplained.com\/#website\"},\"datePublished\":\"2012-11-03T12:03:03+00:00\",\"dateModified\":\"2017-06-11T20:20:47+00:00\",\"author\":{\"@id\":\"https:\/\/codingexplained.com\/#\/schema\/person\/e19c92ec991f571605f047cefeaa950d\"},\"description\":\"If a concrete5 block is not installing together with a concrete5 package and the code is correct, then you might be the victim of a silly flaw in concrete5.\",\"breadcrumb\":{\"@id\":\"https:\/\/codingexplained.com\/coding\/php\/concrete5\/package-block-not-installing#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/codingexplained.com\/coding\/php\/concrete5\/package-block-not-installing\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/codingexplained.com\/coding\/php\/concrete5\/package-block-not-installing#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/codingexplained.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"concrete5 Package Block Not Installing\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/codingexplained.com\/#website\",\"url\":\"https:\/\/codingexplained.com\/\",\"name\":\"Coding Explained\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/codingexplained.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/codingexplained.com\/#\/schema\/person\/e19c92ec991f571605f047cefeaa950d\",\"name\":\"Bo Andersen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codingexplained.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/28f5826f9d5d544b0c5e1ec321dfdfb8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/28f5826f9d5d544b0c5e1ec321dfdfb8?s=96&d=mm&r=g\",\"caption\":\"Bo Andersen\"},\"description\":\"I am a back-end web developer with a passion for open source technologies. I have been a PHP developer for many years, and also have experience with Java and Spring Framework. I currently work full time as a lead developer. Apart from that, I also spend time on making online courses, so be sure to check those out!\",\"sameAs\":[\"https:\/\/codingexplained.com\",\"https:\/\/www.facebook.com\/codingexplained\",\"https:\/\/www.linkedin.com\/in\/ba0708\",\"https:\/\/twitter.com\/codingexplained\",\"https:\/\/www.youtube.com\/c\/codingexplained\"],\"url\":\"https:\/\/codingexplained.com\/author\/andy\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"concrete5 Package Block Not Installing","description":"If a concrete5 block is not installing together with a concrete5 package and the code is correct, then you might be the victim of a silly flaw in concrete5.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/codingexplained.com\/coding\/php\/concrete5\/package-block-not-installing","og_locale":"en_US","og_type":"article","og_title":"concrete5 Package Block Not Installing","og_description":"If a concrete5 block is not installing together with a concrete5 package and the code is correct, then you might be the victim of a silly flaw in concrete5.","og_url":"https:\/\/codingexplained.com\/coding\/php\/concrete5\/package-block-not-installing","og_site_name":"Coding Explained","article_publisher":"https:\/\/www.facebook.com\/codingexplained","article_author":"https:\/\/www.facebook.com\/codingexplained","article_published_time":"2012-11-03T12:03:03+00:00","article_modified_time":"2017-06-11T20:20:47+00:00","og_image":[{"width":1200,"height":444,"url":"https:\/\/codingexplained.com\/wp-content\/uploads\/2015\/11\/codingexplained-fb-promote.png","type":"image\/png"}],"author":"Bo Andersen","twitter_card":"summary_large_image","twitter_creator":"@codingexplained","twitter_site":"@codingexplained","twitter_misc":{"Written by":"Bo Andersen","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/codingexplained.com\/coding\/php\/concrete5\/package-block-not-installing","url":"https:\/\/codingexplained.com\/coding\/php\/concrete5\/package-block-not-installing","name":"concrete5 Package Block Not Installing","isPartOf":{"@id":"https:\/\/codingexplained.com\/#website"},"datePublished":"2012-11-03T12:03:03+00:00","dateModified":"2017-06-11T20:20:47+00:00","author":{"@id":"https:\/\/codingexplained.com\/#\/schema\/person\/e19c92ec991f571605f047cefeaa950d"},"description":"If a concrete5 block is not installing together with a concrete5 package and the code is correct, then you might be the victim of a silly flaw in concrete5.","breadcrumb":{"@id":"https:\/\/codingexplained.com\/coding\/php\/concrete5\/package-block-not-installing#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/codingexplained.com\/coding\/php\/concrete5\/package-block-not-installing"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/codingexplained.com\/coding\/php\/concrete5\/package-block-not-installing#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/codingexplained.com\/"},{"@type":"ListItem","position":2,"name":"concrete5 Package Block Not Installing"}]},{"@type":"WebSite","@id":"https:\/\/codingexplained.com\/#website","url":"https:\/\/codingexplained.com\/","name":"Coding Explained","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/codingexplained.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/codingexplained.com\/#\/schema\/person\/e19c92ec991f571605f047cefeaa950d","name":"Bo Andersen","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codingexplained.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/28f5826f9d5d544b0c5e1ec321dfdfb8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/28f5826f9d5d544b0c5e1ec321dfdfb8?s=96&d=mm&r=g","caption":"Bo Andersen"},"description":"I am a back-end web developer with a passion for open source technologies. I have been a PHP developer for many years, and also have experience with Java and Spring Framework. I currently work full time as a lead developer. Apart from that, I also spend time on making online courses, so be sure to check those out!","sameAs":["https:\/\/codingexplained.com","https:\/\/www.facebook.com\/codingexplained","https:\/\/www.linkedin.com\/in\/ba0708","https:\/\/twitter.com\/codingexplained","https:\/\/www.youtube.com\/c\/codingexplained"],"url":"https:\/\/codingexplained.com\/author\/andy"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3mJkW-6E","_links":{"self":[{"href":"https:\/\/codingexplained.com\/wp-json\/wp\/v2\/posts\/412"}],"collection":[{"href":"https:\/\/codingexplained.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codingexplained.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codingexplained.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codingexplained.com\/wp-json\/wp\/v2\/comments?post=412"}],"version-history":[{"count":9,"href":"https:\/\/codingexplained.com\/wp-json\/wp\/v2\/posts\/412\/revisions"}],"predecessor-version":[{"id":3044,"href":"https:\/\/codingexplained.com\/wp-json\/wp\/v2\/posts\/412\/revisions\/3044"}],"wp:attachment":[{"href":"https:\/\/codingexplained.com\/wp-json\/wp\/v2\/media?parent=412"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codingexplained.com\/wp-json\/wp\/v2\/categories?post=412"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codingexplained.com\/wp-json\/wp\/v2\/tags?post=412"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/codingexplained.com\/wp-json\/wp\/v2\/series?post=412"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}