Task

Convert the following theme functions to use the new table #type:

Module Theme function name Where in Code What is it really?
node theme_node_search_admin function form table

Related issues

Files: 
CommentFileSizeAuthor
#32 convert-node-tables-1938920-32.patch6.14 KBJon Pugh
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 67,759 pass(es), 25 fail(s), and 7 exception(s).
[ View ]
#29 convert-node-tables-1938920-29-do-not-test.patch3.69 KBJon Pugh
#28 convert-node-tables-1938920-28.patch3.72 KBJon Pugh
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 67,704 pass(es), 57 fail(s), and 0 exception(s).
[ View ]
#25 convert-node-tables-1938920-25.patch2.08 KBJon Pugh
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Unable to apply patch convert-node-tables-1938920-25.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#22 convert-node-tables-1938920-22.patch3.06 KBJon Pugh
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 67,838 pass(es), 57 fail(s), and 0 exception(s).
[ View ]
#4 convert-node-tables-1938920-3.patch3.47 KBshanethehat
PASSED: [[SimpleTest]]: [MySQL] 55,223 pass(es).
[ View ]
#3 convert-node-tables-1938920-3.patch3.47 KBshanethehat
PASSED: [[SimpleTest]]: [MySQL] 55,233 pass(es).
[ View ]

Comments

Assigned:Unassigned» shanethehat

I'm not sure if this one needs converting, at least not to the table type. The form is already using type 'detail', so converting it to table removes the detail markup. Is there a way to add the form as a child to the detail type that I'm missing?

StatusFileSize
new3.47 KB
PASSED: [[SimpleTest]]: [MySQL] 55,233 pass(es).
[ View ]

I've done an initial conversion, and the markup seems to match, especially the name attributes of the form elements. The form does not save the content ranking values, but I have tested the original form on a clean install, and that does not seem to save the values either.

The only differences I've seen in the markup are:

  1. The table now has an id attribute.
  2. The help text now appears, it was incorrectly keyed as #info instead of #markup in the original theme function.

Before:

<details class="form-wrapper collapse-processed" open="open" id="edit-content-ranking"><summary role="button" aria-controls="edit-content-ranking" aria-expanded=""><a href="#edit-content-ranking" class="details-title"><span class="details-summary-prefix element-invisible">Show</span> Content ranking</a><span class="summary"></span></summary><div class="details-wrapper"><div class="tableresponsive-toggle-columns"><button style="display: none;" title="Show table cells that were hidden to make the table fit within a small screen." type="button" class="link tableresponsive-toggle">Hide unimportant columns</button></div><table style="visibility: hidden; position: fixed; top: 79px; left: 53px; width: 1198px;" class="sticky-header"><thead><tr><th style="width: 915px; display: table-cell;">Factor</th><th style="width: 240px; display: table-cell;">Weight</th> </tr></thead></table><table class="sticky-enabled responsive-enabled tableresponsive-processed tableheader-processed sticky-table">
<thead><tr><th>Factor</th><th>Weight</th> </tr></thead>
<tbody>
<tr class="odd"><td>Number of comments</td><td><div class="form-item form-type-select form-item-node-rank-comments">
<label class="element-invisible" for="edit-node-rank-comments">Number of comments</label> <select id="edit-node-rank-comments" name="node_rank_comments" class="form-select"><option value="0" selected="selected">0</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option></select>
</div>
</td> </tr>
<tr class="even"><td>Keyword relevance</td><td><div class="form-item form-type-select form-item-node-rank-relevance">
<label class="element-invisible" for="edit-node-rank-relevance">Keyword relevance</label> <select id="edit-node-rank-relevance" name="node_rank_relevance" class="form-select"><option value="0" selected="selected">0</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option></select>
</div>
</td> </tr>
<tr class="odd"><td>Content is sticky at top of lists</td><td><div class="form-item form-type-select form-item-node-rank-sticky">
<label class="element-invisible" for="edit-node-rank-sticky">Content is sticky at top of lists</label> <select id="edit-node-rank-sticky" name="node_rank_sticky" class="form-select"><option value="0" selected="selected">0</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option></select>
</div>
</td> </tr>
<tr class="even"><td>Content is promoted to the front page</td><td><div class="form-item form-type-select form-item-node-rank-promote">
<label class="element-invisible" for="edit-node-rank-promote">Content is promoted to the front page</label> <select id="edit-node-rank-promote" name="node_rank_promote" class="form-select"><option value="0" selected="selected">0</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option></select>
</div>
</td> </tr>
</tbody>
</table>
</div></details>

After:

<details class="form-wrapper collapse-processed" open="open" id="edit-content-ranking"><summary role="button" aria-controls="edit-content-ranking" aria-expanded=""><a href="#edit-content-ranking" class="details-title"><span class="details-summary-prefix element-invisible">Show</span> Content ranking</a><span class="summary"></span></summary><div class="details-wrapper"><em>The following numbers control which properties the content search should favor when ordering the results. Higher numbers mean more influence, zero means the property is ignored. Changing these numbers does not require the search index to be rebuilt. Changes take effect immediately.</em><div class="tableresponsive-toggle-columns"><button style="display: none;" title="Show table cells that were hidden to make the table fit within a small screen." type="button" class="link tableresponsive-toggle">Hide unimportant columns</button></div><table style="visibility: hidden; position: fixed; top: 79px; left: 53px; width: 1198px;" class="sticky-header"><thead><tr><th style="width: 915px; display: table-cell;">Factor</th><th style="width: 240px; display: table-cell;">Weight</th> </tr></thead></table><table id="edit-factors" class="sticky-enabled responsive-enabled tableresponsive-processed tableheader-processed sticky-table">
<thead><tr><th>Factor</th><th>Weight</th> </tr></thead>
<tbody>
<tr class="odd"><td>Number of comments</td><td><div class="form-item form-type-select form-item-node-rank-comments">
<label class="element-invisible" for="edit-node-rank-comments">Number of comments</label> <select id="edit-node-rank-comments" name="node_rank_comments" class="form-select"><option value="0" selected="selected">0</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option></select>
</div>
</td> </tr>
<tr class="even"><td>Keyword relevance</td><td><div class="form-item form-type-select form-item-node-rank-relevance">
<label class="element-invisible" for="edit-node-rank-relevance">Keyword relevance</label> <select id="edit-node-rank-relevance" name="node_rank_relevance" class="form-select"><option value="0" selected="selected">0</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option></select>
</div>
</td> </tr>
<tr class="odd"><td>Content is sticky at top of lists</td><td><div class="form-item form-type-select form-item-node-rank-sticky">
<label class="element-invisible" for="edit-node-rank-sticky">Content is sticky at top of lists</label> <select id="edit-node-rank-sticky" name="node_rank_sticky" class="form-select"><option value="0" selected="selected">0</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option></select>
</div>
</td> </tr>
<tr class="even"><td>Content is promoted to the front page</td><td><div class="form-item form-type-select form-item-node-rank-promote">
<label class="element-invisible" for="edit-node-rank-promote">Content is promoted to the front page</label> <select id="edit-node-rank-promote" name="node_rank_promote" class="form-select"><option value="0" selected="selected">0</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option></select>
</div>
</td> </tr>
</tbody>
</table>
</div></details>

Status:Active» Needs review
StatusFileSize
new3.47 KB
PASSED: [[SimpleTest]]: [MySQL] 55,223 pass(es).
[ View ]

Same patch, with the right status

Status:Needs review» Needs work

The last submitted patch, convert-node-tables-1938920-3.patch, failed testing.

Status:Needs work» Needs review

#4: convert-node-tables-1938920-3.patch queued for re-testing.

Status:Needs review» Postponed

Hmm, so maybe this should be postponed until #1831632: Convert node_rank_ $rank variables to use configuration system lands, since that will change the way the rankings are retrieved in node_search_admin().

Issue tags:+Novice

Tagging.

The data does not with patch in #4.

Status:Postponed» Needs work

Title:Convert node theme tables to table #typeConvert node_search_admin theme tables to table #type
Assigned:shanethehat» Jon Pugh

I am re-rolling #1831632: Convert node_rank_ $rank variables to use configuration system with this patch at the same time, since they depend on one another.

Status:Needs work» Postponed

Patch queued for testing over at #1831632: Convert node_rank_ $rank variables to use configuration system contains the work done here. They are so closely tied it was much easier to include both in the same patch.

Status:Postponed» Closed (duplicate)

So this should be duplicate then?

Status:Closed (duplicate)» Needs work

Status:Needs work» Postponed

I'm working on #1831632: Convert node_rank_ $rank variables to use configuration system and hope to have a patch ready to commit within the next week or so. To avoid conflicting patches, please check the status of that issue before working on this one.

Issue summary:View changes

Removing theme_node_recent_block()

Component:node.module» node system
Issue summary:View changes

(Merging "node system" and "node.module" components for 8.x; disregard.)

Assigned:Jon Pugh» Unassigned
Status:Postponed» Active

Looks like this can probably be re-activated and that possibly this has been partially converted, current code:

<?php
  $table
= array(
   
'#type' => 'table',
   
'#header' => $header,
   
'#rows' => $rows,
  );
?>

So this might just be a matter of moving this #type table out into \Drupal\node\Plugin\Search\NodeSearch::buildConfigurationForm() and removing the theme function.

Issue tags:+Twig

And tagging so we can keep track of this on http://drupaltwig.org.

Issue tags:+Needs reroll

Patch no longer applies.

Issue tags:-Needs reroll

I don't think a reroll is applicable here.

Assigned:Unassigned» Jon Pugh

I'll start on this one again. #NYCcamp

StatusFileSize
new3.06 KB
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 67,838 pass(es), 57 fail(s), and 0 exception(s).
[ View ]

Done!

So simple... $type table assumes all element_children are rows, and element_children of that are columns.

Status:Active» Needs review

Status:Needs review» Needs work

The last submitted patch, 22: convert-node-tables-1938920-22.patch, failed testing.

StatusFileSize
new2.08 KB
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] Unable to apply patch convert-node-tables-1938920-25.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Ok, should be all fixed up.

I refactored the naming of the forms to remain consistent with the config.

Status:Needs work» Needs review

triggering testbot

Status:Needs review» Needs work

The last submitted patch, 25: convert-node-tables-1938920-25.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new3.72 KB
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 67,704 pass(es), 57 fail(s), and 0 exception(s).
[ View ]

Rerolled.

Adding newline at end of file.

Status:Needs review» Needs work

The last submitted patch, 28: convert-node-tables-1938920-28.patch, failed testing.

Adjusting the test now.

Stand by for patch.

StatusFileSize
new6.14 KB
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 67,759 pass(es), 25 fail(s), and 7 exception(s).
[ View ]

Updated the field identifiers, but there's an error happening that I can't figure out:

Fatal error: Call to a member function id() on a non-object in /home/jon/Repos/drupal/core/modules/search/lib/Drupal/search/Tests/SearchRankingTest.php on line 133

<?php
$this
->assertEqual($set[0]['node']->id(), $nodes[$node_rank][1]->id(), 'Search ranking "' . $node_rank . '" order.');
?>

Status:Needs work» Needs review

Status:Needs review» Needs work

The last submitted patch, 32: convert-node-tables-1938920-32.patch, failed testing.