Drupal 6 https://www.joshuafarry.com/ en Sorting by Date in Views https://www.joshuafarry.com/blog/2011/sorting-date-views <span class="field field--name-title field--type-string field--label-hidden">Sorting by Date in Views</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">Josh</span></span> <span class="field field--name-created field--type-created field--label-hidden">Wed, 21/09/2011 - 10:31</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>I recently came across a small problem with sorting views by date. Not by any Node associated date (such as Publish Date, or Update Date), but sorting by a Date Field, as supplied by the <a href="http://drupal.org/project/date">Date module</a>. I was trying to sort the content by the date field, descending, but what I was getting was all sorts of garbled mess, at which point I noticed that there was no granularity setting when adding the field to the Sort list.<br />  <br /> Enter: Arguments.</p> <p>The simple solution in my case was to click the + button to add an argument, then add the same field to the argument. I left everything as default (Title and Breadcrumb as blank, because the title is set elsewhere and I'm not using breadcrumbs) and just changed "<strong>Action to take if argument is not present</strong>" to "Display all values" and "Granularity" to month.<br />  <br /> I also left the same field in the Sort section of the view (sorting by descending) and presto! A view sorted by Date field :)</p></div> <div class="field field--name-field-blog-tags field--type-entity-reference field--label-inline"> <div class="field__label">Tags</div> <div class="field__items"> <div class="field__item"><a href="/taxonomy/term/1" hreflang="en">Drupal 6</a></div> <div class="field__item"><a href="/taxonomy/term/8" hreflang="en">Views</a></div> <div class="field__item"><a href="/taxonomy/term/9" hreflang="en">Views Arguments</a></div> <div class="field__item"><a href="/taxonomy/term/10" hreflang="en">Date</a></div> </div> </div> <section class="field field--name-field-blog-comments field--type-comment field--label-above comment-wrapper"> <h2 class="title comment-form__title">Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=5&amp;2=field_blog_comments&amp;3=comment" token="y1jeKMWHoaChSEAGVwc5uZ-gT13uvOFBkFRfOSdeB9g"></drupal-render-placeholder> </section> Wed, 21 Sep 2011 01:01:00 +0000 Josh 5 at https://www.joshuafarry.com Sharing Menu's across multisites https://www.joshuafarry.com/blog/2011/sharing-menus-across-multisites <span class="field field--name-title field--type-string field--label-hidden">Sharing Menu&#039;s across multisites</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">Josh</span></span> <span class="field field--name-created field--type-created field--label-hidden">Wed, 08/06/2011 - 10:06</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>We're deploying a multisite installation for our new Intranet at work. Essentially, we have a main intranet site (the default install), then we have a site for each department.</p> <p>The idea was to be that the primary links menu would stay the same across all sites. As there are 7 department sites, we didn't really want to copy and paste the menu 7 times, then edit it 7 times, whenever something changes in it. So, the best solution would be to share the appropriate menu table.</p> <p>I got to digging around in the database and it looked like 'menu_links' was the winner, so I shared it across all sites. The primary links menu now works fine across all sites (though you will need to clear your menu cache on all other sites when you update the primary links), but I have noticed a strange oddity. I went to one of my department sites to add the quicklinks menus, which are different for each site. I did them all from the one department because I assumed they would automatically be shared across all other department sites. They're not. They sit in a '[insert prefix here]_menu_custom' just on that one site... Strange.</p> <p>I'm now trying to figure out why this happened and if it is a function of multisite at all. If anyone has any answers for me, I'd be keen to hear them :)</p> <p>Edit (2016): Looking back at this, I recall that sharing the tables for menus was the completely wrong way to go about the problem. If I had my time again, I'd just write a module which would combine two menus into a single menu. The main menu would be the top level and another menu (unique on each department site)would appear below the primary. This would have taken care of the mlid (menu link ID) which was the problem when trying to share the original table.</p></div> <div class="field field--name-field-blog-tags field--type-entity-reference field--label-inline"> <div class="field__label">Tags</div> <div class="field__items"> <div class="field__item"><a href="/taxonomy/term/1" hreflang="en">Drupal 6</a></div> <div class="field__item"><a href="/taxonomy/term/11" hreflang="en">Multisite</a></div> <div class="field__item"><a href="/taxonomy/term/12" hreflang="en">Table Sharing</a></div> </div> </div> <section class="field field--name-field-blog-comments field--type-comment field--label-above comment-wrapper"> <h2 class="title comment-form__title">Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=6&amp;2=field_blog_comments&amp;3=comment" token="dpYbd2vVnCJCXcQ8O44h111--q6kOHp4vaZqvGM8kLU"></drupal-render-placeholder> </section> Wed, 08 Jun 2011 00:36:00 +0000 Josh 6 at https://www.joshuafarry.com https://www.joshuafarry.com/blog/2011/sharing-menus-across-multisites#comments Storage error 139 when adding new content! https://www.joshuafarry.com/blog/2011/storage-error-139-when-adding-new-content <span class="field field--name-title field--type-string field--label-hidden">Storage error 139 when adding new content!</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">Josh</span></span> <span class="field field--name-created field--type-created field--label-hidden">Wed, 18/05/2011 - 14:23</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>I came across this little gem when trying to add content to my newly create Drupal content type. I had just created a new content type and was adding some content of that type to make sure everything was working ok. The content type in question had around 25 fields or so, which was a combination of text areas and image fields.</p> <p>It turns out that INNODB can't take more than 8000 bytes per row. This also doesn't appear to be something that you can increase. I don't know what the reasoning for it is, maybe it's too hard on the transactional setup if you give it too much data at one time.</p> <p>Anyhow! The solution? Change the engine for that table :) I'm using mySQL WorkBench at the moment so all I did was:</p> <ol><li>Open a connection to the server</li> <li>Connect to the database (click the Database menu, the click Query Database)</li> <li>Right-click the problem table, click "Alter Table"</li> <li>in the engine drop-down, select MyISAM.</li> </ol><p> </p> <p>That's it! The content type works again :)</p></div> <div class="field field--name-field-blog-tags field--type-entity-reference field--label-inline"> <div class="field__label">Tags</div> <div class="field__items"> <div class="field__item"><a href="/taxonomy/term/1" hreflang="en">Drupal 6</a></div> <div class="field__item"><a href="/taxonomy/term/6" hreflang="en">Storage Error 139</a></div> <div class="field__item"><a href="/taxonomy/term/7" hreflang="en">MySQL</a></div> </div> </div> <section class="field field--name-field-blog-comments field--type-comment field--label-above comment-wrapper"> <h2 class="title comment-form__title">Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=4&amp;2=field_blog_comments&amp;3=comment" token="uc1Lb6EN7BABm6o1LG_bvkNtKR1zMSzFvkh2eSYvs90"></drupal-render-placeholder> </section> Wed, 18 May 2011 04:53:00 +0000 Josh 4 at https://www.joshuafarry.com https://www.joshuafarry.com/blog/2011/storage-error-139-when-adding-new-content#comments Views Slideshow has some problems with being a block https://www.joshuafarry.com/blog/2011/create-blog-post <span class="field field--name-title field--type-string field--label-hidden">Views Slideshow has some problems with being a block</span> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/user/1" typeof="schema:Person" property="schema:name" datatype="">Josh</span></span> <span class="field field--name-created field--type-created field--label-hidden">Tue, 08/03/2011 - 13:45</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Just a quick one that doesn't seem to be too well documented on the web.</p> <p>I was having a problem with Views Slideshow not working when using Nice Menus at the same time. It turns out that there are a few problems with displaying Views Slideshow, as a block. Nobody's quite figured out how to roll this into a patch for the module yet, but in the meanwhile, there is a simple workaround :)<br /><a href="http://drupal.org/node/823056">http://drupal.org/node/823056</a></p></div> <div class="field field--name-field-blog-tags field--type-entity-reference field--label-inline"> <div class="field__label">Tags</div> <div class="field__items"> <div class="field__item"><a href="/taxonomy/term/1" hreflang="en">Drupal 6</a></div> <div class="field__item"><a href="/taxonomy/term/2" hreflang="en">Views Slideshow</a></div> <div class="field__item"><a href="/taxonomy/term/3" hreflang="en">views_embed_view</a></div> <div class="field__item"><a href="/taxonomy/term/4" hreflang="en">Views As Block</a></div> <div class="field__item"><a href="/taxonomy/term/5" hreflang="en">Views Slideshow As Block</a></div> </div> </div> <section class="field field--name-field-blog-comments field--type-comment field--label-above comment-wrapper"> <h2 class="title comment-form__title">Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=3&amp;2=field_blog_comments&amp;3=comment" token="sakYYvZOls5kfGBdE8P9OqUsJ8weSKuhrRjDRw2dR04"></drupal-render-placeholder> </section> Tue, 08 Mar 2011 03:15:00 +0000 Josh 3 at https://www.joshuafarry.com