Drupal Comment Form Missing - drupal-6

I've inherited a Drupal 6 project and I am in need of a comment form on one of my pages. The module is enabled and the content type is set to allow for comments.
The permissions are set as follows:
Anonymous User: Access Comments, Post Comments
Authenticated User:
Access Comments, Post Comments
Content Admin: Access Comments,
Administer Comments, Post Comments, Post Comments Without Approval
A link displays below the page contents, "Add new comment." Clicking this link takes me to the URL comment/reply/28#comment-form, which is displaying the same content and nothing new. I believe there should be a form displaying on this page, but I cannot for the life of me figure out what I am missing.
The site is on a custom theme - is there somewhere that I need to make a PHP call to show the form on a page? I searched through a couple of the other themes(that apparently come standard with Drupal) and could find no reference other than comment.tpl.php, which is identical to the one in this custom theme.
EDIT: Per Oswald's suggestion in an answer below, I installed the Theme Developer add-on to try to track down what is going on. The results of going into devel mode on the page in question are as follows:
... (Object) stdClass
nid (String, 2 characters ) 28
type (String, 5 characters ) story
language (String, 0 characters )
uid (String, 1 characters ) 1
status (String, 1 characters ) 1
created (String, 10 characters ) 1311112998
changed (String, 10 characters ) 1311113045
comment (String, 1 characters ) 2
promote (String, 1 characters ) 0
moderate (String, 1 characters ) 0
sticky (String, 1 characters ) 0
tnid (String, 1 characters ) 0
translate (String, 1 characters ) 0
vid (String, 2 characters ) 28
revision_uid (String, 1 characters ) 1
title (String, 12 characters ) testimonials
body (String, 2076 characters ) Lorem Ipsum blah blah blah
teaser (String, 554 characters ) Lorem Ipsum blah blah blah
log (String, 0 characters )
revision_timestamp (String, 10 characters ) 1311113045
format (String, 1 characters ) 1
name (String, 8 characters ) blahblahblah
picture (String, 0 characters )
data (String, 72 characters ) a:1:{s:13:"form_build_id";s:37:"form-4fad331ed7...
last_comment_timestamp (String, 10 characters ) 1311112998
last_comment_name (NULL)
comment_count (String, 1 characters ) 0
taxonomy (Array, 0 elements)
The only thing that stood out to me was the data section, the full contents of which are: a:1:{s:13:"form_build_id";s:37:"form-4fad331ed7e2000d316142aaf87c302f";}.
The parents of the page /comment/reply/28#comment-form are theme_markup < node < page. The candidate function names are templatename_markup < phptemplate_markup < theme_markup.

The page template that is used to render the page (usually page.tpl.php) should know a variable called $content. This variable should contain the rendered node and the rendered comment form.
Use the Theme developer module to find out which page template is used to render comment/reply/28#comment-form. Examine that template file to find out whether $content is actually used by the template.

Have you checked the theme's configuration? Some themes have an option to disable the display of the comment form (and other things).

I ended up re-writing the template from the ground up and got the comments working. No explanation as to what was wrong with it initially.

I was working on a site that someone else had put up some years ago and was facing this problem too. After testing with other themes and making sure all the settings were right, I was sure it was a conflict with a module. And it sure was, the original web developer had enabled Commentsblock which disabled the comments on node template and made them available only in a block.
Should have gone through the modules first, that was pretty obvious..

Related

Netsuite Custom Field with REGEXP_REPLACE to strip HTML code except carriage return

I have a custom field with some HTML code in it:
<h1>A H1 Heading</h1>
<h2>A H2 Heading</h2>
<b>Rich Text</b><br>
fsdfafsdaf df fsda f asdfa f asdfsa fa sfd<br>
<ol><li>numbered list</li><li>fgdsfsd f sa</li></ol>Another List<br>
<ul><li>bulleted</li></ul>
I also have another non-stored field where I want to display the plain text version of the above using REGEXP_REPLACE, while preserving the carriage returns/line breaks, maybe even converting <br> and <br/> to \r\n
However the patterns etc... seem to be different in NetSuite fields compared to using ?replace(...) in freemarker... and I'm terrible with remembering regexp patterns :)
Assuming the html text is stored in custitem_htmltext what expression could i use as the default value of the NetSuite Text Area custom field to display the html code above as:
A H1 Heading
A H2 Heading
Rich Text
fsdfafsdaf df fsda f asdfa f asdfsa fa sfd
etc...
I understand the bulleted or numbered lists will look crap.
My current non-working formula is:
REGEXP_REPLACE({custitem_htmltext},'<[^<>]*>','')
I've also tried:
REGEXP_REPLACE({custitem_htmltext},'<[^>]+>','') - didn't work
When you use a Text Area type of custom field and input HTML, NetSuite seems to change the control characters ('<' and '>') to HTML entities ('<' and '>'). You can see this if you input the HTML and then change the field type to Long Text.
If you change both fields to Long Text, and re-input the data and formula, the REGEXP_REPLACE() should work as expected.
From what I have learned recently, Netsuite encodes data by default to URL format, so from < to < and > to >.
Try using triple handlebars e.g. {{{custitem_htmltext}}}
https://docs.celigo.com/hc/en-us/articles/360038856752-Handlebars-syntax
This should stop the default behaviour and allow you to use in a formula/saved search.

Extract Arabic Text using iTextsharp get number only?

I try To extract Arabic Text from PDF file but it extract only number and the result like this :
: 7234569 1439/08/07 : : 1 2375173941 14 08 6 39266 1050672243 2280 30 400 24 415 24 15 720 30 402 30 499 14 07 1 610117038085 0 1069508677 0 :
My code :
public static string GetTextFromAllPages(string pdfPath) {
PdfReader reader = new PdfReader(pdfPath);
string result = null ;
//for (int i = 1; i <= reader.NumberOfPages; i++)
result = PdfTextExtractor.GetTextFromPage(reader, 1, new LocationTextExtractionStrategy()); return result;
}
Any help Please?
The embedded font for Arabic glyphs in your PDF contains this ToUnicode CMap:
/CIDInit /ProcSet findresource begin
12 dict begin
begincmap
/CIDSystemInfo << /Registry (Adobe) /Ordering (UCS) /Supplement 0 >> def
/CMapName /Adobe-Identity-UCS def
/CMapType 2 def
1 begincodespacerange
<0000> <FFFF>
endcodespacerange
endcmap
CMapName currentdict /CMap defineresource pop
end
end
According to ISO 32000-1, section 9.10.3 ToUnicode CMaps:
It shall use the beginbfchar, endbfchar, beginbfrange, and endbfrange operators to define the mapping from character codes to Unicode character sequences expressed in UTF-16BE encoding.
Unfortunately your CMap does not use these operators at all and, therefore, does not define any mappings to Unicode.
Furthermore the font has an Encoding of Identity-H and its descendant CIDFont has a ROS Adobe-Identity-0 which means that character code, CID, and GID values are equal for a character but doesn't imply any mapping of them to Unicode.
Thus, the font is missing the information required for text extraction according to ISO 32000-1 section 9.10.2 Mapping Character Codes to Unicode Values.
(In such a situation text extractors can only guess, and such guesswork usually only works for a special type of documents the extractor is optimized for. You might want to try to enhance iText to be able to guess correctly in your case but that will require you to study the PDF specification, the iText text extraction code, and your sample files in detail.)
By the way, a good first test whether text extraction is feasible is to open the PDF in Adobe Reader and to copy and paste the text in question to an editor or word processor. If this does not work (and in the case at hand it does not work), chances are that the file does have incomplete or misleading information for text extraction (or none at all).

Thousand separator is not applied by website module odoo9

I have issue in Website odoo with product price séperator
i change the configuration in Settings >Translations >Languages "Thousands Separator" Field
But is not applied in Website(Look picture )
for example 200 000 > in website 200,000
How to delete the comma
I want to display 200 000
Hello friends I found the solution
>>> Go to language setting,
>>> set that you want a ' ' as thousand separator, (Put space)
>> and that works out of the box
>>>> -The only specific case that is if you don't want anything, you need to set an empty char (eg: ​) because by default, we use a comma if no symbol is given ! >>>> [the solution][1] (www.zupimages.net/up/17/25/mnn1.png)
tousand separator : " " ;
[1]: http://zupimages.net/up/17/25/mnn1.png

How to verify ANY text is present with selenium IDE

I know how to verify if a specific text is present in a web page using Selenium IDE. But what I wanted to know is, can you verify that any text is present in an element?
For example there's a text box with the title "Top Champion". This text box will be changed daily with the name of a person. Now I just wanted to check whether there is a text in this text box, no matter what the text actually is. I've tried the verify text command and tried blanking the value, but it doesn't work. If the command can return a true or false command that would be really helpful
BTW, verify value doesn't work either since the element that I'm testing is not a form field
Your best bet is as follows (I have written single tests for this for numbers)
Medium rigour:
waitForText | css=.SELECTORS | regex:.+?
This will wait until there is at least 1 character present.
Strong rigour (only works if you have a subset of characters present):
waitForText | css=.SELECTORS | regex:^[0-9]+$
This will wait until there is text. This text must start with a number, have at least 1 number, and then finish. It does not permit any character outside of the subset given. An example you could do to match numbersNAMEnumbers would be.
waitForText | css=.SELECTORS | regex:^[0-9]+[a-zA-Z]+[0-9]+$
This would wait for a string such as 253432234BobbySmith332
Luke
If i have understood your question properly there below is one way you can search for an element contains a string. Not sure if this is what you are looking.
List<WebElement> findElement = webElement.findElements(By.xpath("YOUR_TEXTINPUT_PATH_HERE"));
if( findElement.size() > 0 ){
if( findElement.get(0).getText() != null && findElement.get(0).getText().indexOf("THE_STRING_THAT_YOU_WANT_TO SEARCH") != -1 ) {
// IF IT COMES HERE, THAT MEANS THE ELEMENT IS PRESENT WITH THE TEXT
}
}
store text|[your element]|StoredText
execute script|return ${StoredText}.length > 0|x
assert|x|true
Using these three lines in the Selenium IDE, the first line will extract the text from the element into the variable StoredText.
The second line will store whether the length of that text is greater than zero into the variable x (a true or false result).
The third line asserts that the result was true, failing the test if not. You don't need the third line if all you want is the true or false result.
So if the element contains any text, the extracted text length will be greater than zero, the variable x will be true, and the assert will pass. This verifies that any text is present in the element.

String Concatenation

As I asked in my previous question(Link) about concatenating a multipart string of variable lengths, I used the method answered there by rkhayrov and now, my function looks like this:
local sToReturn = string.format( "\t%03s\t%-25s\t%-7s\n\t", "S. No.", "UserName", "Score" )
SQLQuery = assert( Conn:execute( string.format( [[SELECT username, totalcount FROM chatstat ORDER BY totalcount DESC LIMIT %d]], iLimit ) ) )
DataArray = SQLQuery:fetch ({}, "a")
i = 1
while DataArray do
sTemp = string.format( "%03s\t%025s\t%-7d", tostring(i), DataArray.username, DataArray.totalcount )
sToReturn = sToReturn..sTemp.."\n\t"
DataArray = SQLQuery:fetch ({}, "a")
i = i + 1
end
But, even now, the value of score is still not following the order as required. The max length of username is 25. I've used %025s inside the while loop because I want the usernames to be right-justified, while the %-25s is to make the word UserName centre justified.
EDIT
Current output:
Required Output:
Displaying the list of top 5 chit-chatters.
S. No. UserName Score
1 Keeda 9440
2 _2.2_™ 7675
3 aim 7057
4 KGBRULES 6770
5 Guddu 6322
I think it's because of difference in fonts, but since most of the clients have Windows 7 default fonts(Tahoma/Verdana at 11px), I need optimum result for at-least that.
I think it's because of difference in fonts
It is. string.format formats by inserting whitespace. That only works for a fixed width fonts (i.e. all characters have the same width, including whitespace).
since most of the clients have Windows 7 default fonts(Tahoma/Verdana at 11px)
In what? How are they viewing your output? Do you write it to a textfile, that they then open in the editor of their choice (likely Notepad)? Then this approach will simply not work.
Don't know enough about your output requirements to steer you any futher, but it's worth noting that everyone has a browser so HTML output is very portable.
string.format doesn't truncate - the width of the field is minimum, not maximum. You'll have to truncate the strings to 25 characters yourself with something like DataArray.username:sub(0,25).
I'd remove the tabs from the string.format; and use the justification provided by %25s only. Won't be perfect but will probably be closer.
Use a fixed-width font if you can.

Resources